on f75b368 help sign in
95 lines 2.0 kB history raw
1-- |
2-- Module : Streamly.Data.Stream.StreamK
3-- Copyright : (c) 2017 Composewell Technologies
4--
5-- License : BSD3
6-- Maintainer : streamly@composewell.com
7-- Stability : released
8-- Portability : GHC
9--
10-- Streams using Continuation Passing Style (CPS). See notes in "Data.Stream"
11-- module to know when to use this module.
13-- primitive/open loop operations that can be used recursively e.g. uncons,
14-- foldBreak, parseBreak should not be converted from StreamD for use in
15-- StreamK, instead native StreamK impl should be used.
16--
17-- Closed loop operations like repeat, replicate, iterate etc can be converted
18-- from StreamD.
19--
20-- In the last phase any operation like (toStreamK . f . toStreamD) should be
21-- rewritten to a K version of f.
22-- XXX Need to add rewrite rules for all missing StreamD operations.
23--
24module Streamly.Data.Stream.StreamK
25 (
26 StreamK
28 -- * Construction
29 -- ** Primitives
30 , nil
31 , nilM
32 , cons
33 , consM
35 -- ** From Values
36 , fromPure
37 , fromEffect
39 -- ** From Stream
40 , fromStream
41 , toStream
43 -- ** From Containers
44 , fromFoldable
46 -- * Elimination
48 -- ** Primitives
49 , uncons
51 -- -- ** Folding
52 -- , foldBreak
54 -- ** Parsing
55 -- , parseBreak
56 , parseBreakChunks
57 , parseChunks
59 -- * Combining Two Streams
60 -- ** Appending
61 , append
63 -- ** Interleaving
64 , interleave
66 -- ** Merging
67 , mergeBy
68 , mergeByM
70 -- ** Zipping
71 , zipWith
72 , zipWithM
74 -- ** Cross Product
75 -- XXX is "bind/concatFor" better to have than crossWith?
76 -- crossWith f xs1 xs2 = concatFor xs1 (\x -> fmap (f x) xs2)
77 , crossWith
78 -- , cross
79 -- , joinInner
80 -- , CrossStreamK (..)
82 -- * Stream of streams
83 , concatEffect
84 -- , concatMap
85 , concatMapWith
86 , mergeMapWith
88 -- * Buffered Operations
89 , reverse
90 , sortBy
91 )
92where
94import Streamly.Internal.Data.Stream.StreamK
95import Prelude hiding (reverse, zipWith)