1 {-# LANGUAGE NoMonomorphismRestriction #-}
2 {-# LANGUAGE OverloadedStrings #-}
3 {-# LANGUAGE Rank2Types #-}
4 {-# OPTIONS_GHC -Wno-missing-signatures #-}
6 import Data.Maybe (fromJust)
7 import qualified Control.Monad.Classes as MC
8 import qualified Network.HTTP.Client as Client
9 import qualified Pipes as P
12 import Symantic.HTTP.Client
13 import Symantic.HTTP.Pipes ()
17 -- | Derive the callers of the client.
24 manager <- Client.newManager Client.defaultManagerSettings
25 let baseURI = fromJust $ parseURI "http://localhost:8080"
26 let env = clientEnv manager baseURI
28 print =<< runClient env (client_succ 42)
29 -- Should print 4, 3, 2 then 1
30 (print =<<) $ runClientStream env (client_countdown 4) $ \pipe ->