Skip to content

Commit

Permalink
RankNTypes for client
Browse files Browse the repository at this point in the history
  • Loading branch information
kazu-yamamoto committed May 29, 2023
1 parent 9968ed1 commit 8919ebb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion util/client.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}

module Main where

Expand All @@ -14,12 +15,13 @@ serverName :: String
serverName = "127.0.0.1"

main :: IO ()
main = runTCPClient serverName "80" $ runHTTP2Client serverName
main = runTCPClient serverName "8080" $ runHTTP2Client serverName
where
cliconf host = ClientConfig "http" (C8.pack host) 20
runHTTP2Client host s = E.bracket (allocSimpleConfig s 4096)
freeSimpleConfig
(\conf -> run (cliconf host) conf client)
client :: Client ()
client sendRequest = do
let req0 = requestNoBody methodGet "/" []
client0 = sendRequest req0 $ \rsp -> do
Expand Down

0 comments on commit 8919ebb

Please sign in to comment.