Copyright | (c) 2018 Composewell Technologies (c) Roman Leshchinskiy 2008-2010 |
---|---|
License | BSD-3-Clause |
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- fold :: Monad m => Fold m a b -> Stream m a -> m b
- parse :: MonadThrow m => Parser m a b -> Stream m a -> m b
- parse_ :: MonadThrow m => Parser m a b -> Stream m a -> m (b, Stream m a)
- uncons :: Monad m => Stream m a -> m (Maybe (a, Stream m a))
- foldrM :: Monad m => (a -> m b -> m b) -> m b -> Stream m a -> m b
- foldr :: Monad m => (a -> b -> b) -> 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
- foldr1 :: Monad m => (a -> a -> a) -> Stream m a -> m (Maybe a)
- foldlM' :: Monad m => (b -> a -> m b) -> m b -> Stream m a -> m b
- foldl' :: Monad m => (b -> a -> b) -> b -> Stream m a -> m b
- foldlMx' :: Monad m => (x -> a -> m x) -> m x -> (x -> m b) -> Stream m a -> m b
- foldlx' :: Monad m => (x -> a -> x) -> x -> (x -> b) -> Stream m a -> m b
- drain :: Monad m => Stream m a -> m ()
- mapM_ :: Monad m => (a -> m b) -> Stream m a -> m ()
- null :: Monad m => Stream m a -> m Bool
- head :: Monad m => Stream m a -> m (Maybe a)
- headElse :: Monad m => a -> Stream m a -> m a
- tail :: Monad m => Stream m a -> m (Maybe (Stream m a))
- last :: Monad m => Stream m a -> m (Maybe a)
- elem :: (Monad m, Eq a) => a -> Stream m a -> m Bool
- notElem :: (Monad m, Eq a) => a -> Stream m a -> m Bool
- all :: Monad m => (a -> Bool) -> Stream m a -> m Bool
- any :: Monad m => (a -> Bool) -> Stream m a -> m Bool
- maximum :: (Monad m, Ord a) => Stream m a -> m (Maybe a)
- maximumBy :: Monad m => (a -> a -> Ordering) -> Stream m a -> m (Maybe a)
- minimum :: (Monad m, Ord a) => Stream m a -> m (Maybe a)
- minimumBy :: Monad m => (a -> a -> Ordering) -> Stream m a -> m (Maybe a)
- lookup :: (Monad m, Eq a) => a -> Stream m (a, b) -> m (Maybe b)
- findM :: Monad m => (a -> m Bool) -> Stream m a -> m (Maybe a)
- find :: Monad m => (a -> Bool) -> Stream m a -> m (Maybe a)
- (!!) :: Monad m => Stream m a -> Int -> m (Maybe a)
- the :: (Eq a, Monad m) => Stream m a -> m (Maybe a)
- toList :: Monad m => Stream m a -> m [a]
- toListRev :: Monad m => Stream m a -> 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
- isPrefixOf :: (Eq a, Monad m) => Stream m a -> Stream m a -> m Bool
- isSubsequenceOf :: (Eq a, Monad m) => Stream m a -> Stream m a -> m Bool
- stripPrefix :: (Eq a, Monad m) => Stream m a -> Stream m a -> m (Maybe (Stream m a))
Running a Fold
parse_ :: MonadThrow m => Parser m a b -> Stream m a -> m (b, Stream m a) Source #
Run a Parse
over a stream and return rest of the Stream.
Stream Deconstruction
uncons :: Monad m => Stream m a -> m (Maybe (a, Stream m a)) Source #
Does not fuse, has the same performance as the StreamK version.
Right Folds
Left Folds
Specific Fold Functions
mapM_ :: Monad m => (a -> m b) -> Stream m a -> m () Source #
Execute a monadic action for each element of the Stream
To containers
Multi-Stream Folds
Comparisons
These should probably be expressed using zipping operations.
cmpBy :: Monad m => (a -> b -> Ordering) -> Stream m a -> Stream m b -> m Ordering Source #
Compare two streams lexicographically
Substreams
These should probably be expressed using parsers.