2import Streamly.Prelude (drain, nil, yieldM, (|:))
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 stream construction"
13 drain . parallely $ google |: bing |: duckduckgo |: nil
15 putStrLn "\nUsing parallel semigroup composition"
16 drain . parallely $ yieldM google <> yieldM bing <> yieldM duckduckgo
18 putStrLn "\nUsing parallel applicative zip"
20 (,,) <$> yieldM google <*> yieldM bing <*> yieldM duckduckgo
23 get :: String -> IO ()
24 get s = httpNoBody (parseRequest_ s) >> print s
26 google, bing, duckduckgo :: IO ()
27 google = get "https://www.google.com/search?q=haskell"
28 bing = get "https://www.bing.com/search?q=haskell"
29 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