Created
February 7, 2019 00:16
-
-
Save chris-martin/0dead7d6e9c57ad60d1a6ed5b956cb91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Pipes | |
import Pipes.HTTP | |
import qualified Pipes.Prelude as P | |
import qualified Pipes.ByteString as PB | |
import qualified Data.ByteString as BS | |
url = "https://typeclasses.com" | |
fetch url action = | |
do | |
req <- parseRequest url | |
m <- newManager tlsManagerSettings | |
withHTTP req m action | |
main = | |
fetch url $ \response -> | |
P.sum (responseBody response >-> P.map BS.length) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment