1module Streamly.Examples.SearchEngineQuery where
4import Streamly.Prelude (once)
5import Network.HTTP.Simple
7-- Runs three search engine queries in parallel.
8searchEngineQuery :: IO ()
10 putStrLn "Using parallel alternative"
11 runStream . parallely $ google <> bing <> duckduckgo
13 putStrLn "\nUsing parallel applicative zip"
14 runStream . zipParallely $ (,,) <$> google <*> bing <*> duckduckgo
17 get :: IsStream t => String -> t IO ()
18 get s = once (httpNoBody (parseRequest_ s) >> putStrLn (show s))
20 google, bing, duckduckgo :: IsStream t => t IO ()
21 google = get "https://www.google.com/search?q=haskell"
22 bing = get "https://www.bing.com/search?q=haskell"
23 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