Skip to content

Instantly share code, notes, and snippets.

@sdiehl
Created August 17, 2012 13:52
Show Gist options
  • Select an option

  • Save sdiehl/3378849 to your computer and use it in GitHub Desktop.

Select an option

Save sdiehl/3378849 to your computer and use it in GitHub Desktop.
applicative_url for dabeaz
import Network.HTTP
import Data.Functor ((<$>))
import Control.Applicative ((<*>))
fetch1 = simpleHTTP (getRequest "http://www.dabeaz.com/") >>= getResponseBody
fetch2 = simpleHTTP (getRequest "http://www.dabeaz.com/blog.html") >>= getResponseBody
combined = (++) <$> fetch1 <*> fetch2
main :: IO ()
main = combined >>= print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment