1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE TypeApplications #-}
4 import qualified Control.Concurrent as Concurrent
5 import qualified Control.Monad.Classes as MC
6 import qualified Network.Wai as Wai
7 import qualified Network.Wai.Handler.Warp as Warp
8 import qualified Pipes.Prelude as P
11 import Symantic.HTTP.Server
12 import Symantic.HTTP.Pipes ()
16 -- | Derive an application from the handlers of the server.
17 app :: Wai.Application
27 (`P.unfoldr` 1) $ \i ->
31 putStrLn $ "wait 1s to send: "<>show i
32 Concurrent.threadDelay 1000000
33 return $ Right (i,i+1)
37 main = Warp.run 8080 app