2import Streamly.Prelude (once)
3import Network.HTTP.Simple
5-- | Runs three search engine queries in parallel and prints the search engine
6-- names in the fastest first order.
8-- Does it twice using two different ways.
12 putStrLn "Using parallel semigroup composition"
13 runStream . parallely $ google <> bing <> duckduckgo
15 putStrLn "\nUsing parallel applicative zip"
16 runStream . zipAsyncly $ (,,) <$> google <*> bing <*> duckduckgo
19 get :: IsStream t => String -> t IO ()
20 get s = once (httpNoBody (parseRequest_ s) >> putStrLn (show s))
22 google, bing, duckduckgo :: IsStream t => t IO ()
23 google = get "https://www.google.com/search?q=haskell"
24 bing = get "https://www.bing.com/search?q=haskell"
25 duckduckgo = get "https://www.duckduckgo.com/?q=haskell"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list