haskus-utils-1.5: Haskus utility modules

Safe HaskellNone
LanguageHaskell2010

Haskus.Utils.MonadStream

Description

Monadic tree with cache

Synopsis

Documentation

data MonadStream m n a Source #

Monadic stream with cache

Both the structure and the values may be monadically dependent. The last monadic values read can be stored in a cache.

Constructors

PureStream a (n (MonadStream m n a))

Pure stream

Eq s => MonadStream (MonadVarNE m s (n (MonadStream m n a)))

Monadic stream

Instances
Functor n => Functor (MonadStream m n) Source # 
Instance details

Defined in Haskus.Utils.MonadStream

Methods

fmap :: (a -> b) -> MonadStream m n a -> MonadStream m n b #

(<$) :: a -> MonadStream m n b -> MonadStream m n a #

type MonadTree m a = MonadStream m [] a Source #

Monadic rose tree

type MonadList m a = MonadStream m Maybe a Source #

Monadic list

showMonadStream :: (Foldable n, Show a, Eq (n (MonadStream m n a)), Monoid (n (MonadStream m n a))) => MonadStream m n a -> String Source #

Pretty-show an MonadStream

showMonadStreams :: (Foldable n, Show a, Eq (n (MonadStream m n a)), Monoid (n (MonadStream m n a))) => n (MonadStream m n a) -> String Source #

Pretty-show some MonadStreams

updateMonadStream :: (Monad m, Traversable n) => MonadStream m n a -> m (MonadStream m n a) Source #

Update a MonadStream recursively. Reuse cached values when possible

updateMonadStreamMaybe :: (Monad m, Traversable n) => MonadStream m n a -> m (Maybe (MonadStream m n a)) Source #

Update a MonadStream recursively. Reuse cached values when possible

updateMonadStreamsMaybe :: (Monad m, Traversable n) => n (MonadStream m n a) -> m (Maybe (n (MonadStream m n a))) Source #

Update a MonadStream forest recursively. Reuse cached values when possible

updateMonadStreams :: (Monad m, Traversable n) => n (MonadStream m n a) -> m (n (MonadStream m n a)) Source #

Update a MonadStream forest recursively