1{-# LANGUAGE FlexibleContexts #-}
3-- | This example generates two streams sorted in ascending order and merges
4-- them in ascending order, concurrently.
6-- Compile with '-threaded -with-rtsopts "-N"' GHC options to use the
10import System.Random (getStdGen, randoms)
11import Data.List (sort)
12import Data.Ord (compare)
15import qualified Streamly.Prelude as S
17getSorted :: Serial Word16
19 g <- S.yieldM getStdGen
20 let ls = take 100000 (randoms g) :: [Word16]
21 foldMap return (sort ls)
24main = S.last (S.mergeAsyncBy compare getSorted getSorted) >>= print
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