JYU-Utils-0.1.1.2: Some utility functions for JYU projects

Utils.Stream

Synopsis

Documentation

data Stream m a Source

Stream of monadic values

Constructors

Terminated 
Value (m (a, Stream m a)) 

Instances

Monad m => Functor (Stream m)

Map over a stream

Monad m => Applicative (Stream m) 

sideEffect :: Monad m => (a -> m ()) -> Stream m a -> Stream m aSource

Attaching side effects

data LRB a b c Source

Repeating stream

Create a stream by iterating a monadic action

Pure and monadic left fold over a stream

Merge two (time)streams

Constructors

L a 
B b 
R c 

Instances

(Show a, Show b, Show c) => Show (LRB a b c) 

sequenceS :: Monad m => Stream m (m a) -> Stream m aSource

mapMS :: Monad m => (a -> m b) -> Stream m a -> Stream m bSource

dropS :: Monad m => Int -> Stream m a -> Stream m aSource

Drop elements from the stream. Due to stream structure, this operation cannot fail gracefully when dropping more elements than what is found in the stream

takeS :: Monad m => Int -> Stream m a -> Stream m aSource

pairS :: Monad m => Stream m a -> Stream m (a, a)Source

terminateOn :: Monad m => (a -> Bool) -> Stream m a -> Stream m aSource