1module Asyncly.Examples.SearchEngineQuery where
4import Asyncly.Prelude (ZipAsync (..))
5import Network.HTTP.Simple
7-- Runs three search engine queries in parallel.
8searchEngineQuery :: IO ()
10 putStrLn "Using parallel alternative"
11 runAsyncly $ google <|> bing <|> duckduckgo
13 putStrLn "\nUsing parallel applicative zip"
14 runAsyncly $ getZipAsync $
15 (,,) <$> ZipAsync google <*> ZipAsync bing <*> ZipAsync duckduckgo
18 get s = liftIO (httpNoBody (parseRequest_ s) >> putStrLn (show s))
19 google = get "https://www.google.com/search?q=haskell"
20 bing = get "https://www.bing.com/search?q=haskell"
21 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