on master help sign in
Add the fastest search engine example
0acab07Harendra Kumar
examples/fastest.hsnew file+15
@@ -0,0 +1,15 @@
1+#!/usr/bin/env stack
2+-- stack runghc
3+
4+import Asyncly
5+import Network.HTTP.Simple
6+
7+main = do
8+ let urls = [ "https://www.google.com/search?q=haskell"
9+ , "https://www.duckduckgo.com/?q=haskell"
10+ , "https://www.bing.com/search?q=haskell"
11+ ]
12+ xs <- toList $ foldWith (<|>) $ map get urls
13+ mapM_ (putStrLn . show) $ zip [1..] xs
14+
15+ where get s = liftIO $ httpNoBody (parseRequest_ s) >> return s