Copyright | (c) 2018 Harendra Kumar (c) Roman Leshchinskiy 2008-2010 |
---|---|
License | BSD3 |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Step s a
- data Stream m a where
- fromStreamK :: Monad m => Stream m a -> Stream m a
- toStreamK :: Monad m => Stream m a -> Stream m a
- fromStreamD :: (IsStream t, Monad m) => Stream m a -> t m a
- map :: Monad m => (a -> b) -> Stream m a -> Stream m b
- mapM :: Monad m => (a -> m b) -> Stream m a -> Stream m b
- yield :: Applicative m => a -> Stream m a
- yieldM :: Monad m => m a -> Stream m a
- concatMap :: Monad m => (a -> Stream m b) -> Stream m a -> Stream m b
- concatMapM :: Monad m => (a -> m (Stream m b)) -> Stream m a -> Stream m b
- foldrT :: (Monad m, Monad (t m), MonadTrans t) => (a -> t m b -> t m b) -> t m b -> Stream m a -> t m b
- foldrM :: Monad m => (a -> m b -> m b) -> m b -> Stream m a -> m b
- foldrMx :: Monad m => (a -> m x -> m x) -> m x -> (m x -> m b) -> Stream m a -> m b
- foldr :: Monad m => (a -> b -> b) -> b -> Stream m a -> m b
- foldrS :: Monad m => (a -> Stream m b -> Stream m b) -> Stream m b -> Stream m a -> Stream m b
- foldl' :: Monad m => (b -> a -> b) -> b -> Stream m a -> m b
- foldlM' :: Monad m => (b -> a -> m b) -> b -> Stream m a -> m b
- foldlx' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Stream m a -> m b
- foldlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> m b
- toList :: Monad m => Stream m a -> m [a]
- fromList :: Applicative m => [a] -> Stream m a
- eqBy :: Monad m => (a -> b -> Bool) -> Stream m a -> Stream m b -> m Bool
- cmpBy :: Monad m => (a -> b -> Ordering) -> Stream m a -> Stream m b -> m Ordering
- take :: Monad m => Int -> Stream m a -> Stream m a
- data GroupState s fs
- = GroupStart s
- | GroupBuffer s fs Int
- | GroupYield fs (GroupState s fs)
- | GroupFinish
- groupsOf :: Monad m => Int -> Fold m a b -> Stream m a -> Stream m b
- groupsOf2 :: Monad m => Int -> m c -> Fold2 m c a b -> Stream m a -> Stream m b
The stream type
A stream consists of a step function that generates the next step given a current state, and the current state.
Instances
MonadTrans Stream Source # | |
Defined in Streamly.Internal.Data.Stream.StreamD.Type | |
Monad m => Monad (Stream m) Source # | |
Functor m => Functor (Stream m) Source # | |
Applicative f => Applicative (Stream f) Source # | |
MonadThrow m => MonadThrow (Stream m) Source # | |
Defined in Streamly.Internal.Data.Stream.StreamD.Type |
mapM :: Monad m => (a -> m b) -> Stream m a -> Stream m b Source #
Map a monadic function over a Stream
foldrT :: (Monad m, Monad (t m), MonadTrans t) => (a -> t m b -> t m b) -> t m b -> Stream m a -> t m b Source #
foldrS :: Monad m => (a -> Stream m b -> Stream m b) -> Stream m b -> Stream m a -> Stream m b Source #
cmpBy :: Monad m => (a -> b -> Ordering) -> Stream m a -> Stream m b -> m Ordering Source #
Compare two streams lexicographically
data GroupState s fs Source #
GroupStart s | |
GroupBuffer s fs Int | |
GroupYield fs (GroupState s fs) | |
GroupFinish |