1{-# LANGUAGE FlexibleContexts #-}
4import System.Random (getStdGen, randoms)
7import Streamly.Prelude (yieldM)
8import qualified Streamly.Prelude as A
10getSorted :: Serial Word16
13 let ls = take 100000 (randoms g) :: [Word16]
14 foldMap return (sort ls)
16-- | merge two streams generating the elements from each in parallel
17mergeAsync :: Ord a => Serial a -> Serial a -> Serial a
19 x <- yieldM $ mkAsync a
20 y <- yieldM $ mkAsync b
23merge :: Ord a => Serial a -> Serial a -> Serial a
25 a1 <- yieldM $ A.uncons a
29 b1 <- yieldM $ A.uncons b
31 Nothing -> return x <> ma
34 then return y <> merge (return x <> ma) mb
35 else return x <> merge ma (return y <> mb)
39 xs <- A.toList $ mergeAsync getSorted getSorted
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