graft-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Effect.Writer

Documentation

data MonadWriterEffect (w :: Type) :: Effect where Source #

Constructors

Writer :: forall (w :: Type) (m :: Type -> Type) (a :: Type). (a, w) -> MonadWriterEffect w m a 
Tell :: forall (w :: Type) (m :: Type -> Type). w -> MonadWriterEffect w m () 
Listen :: forall (w :: Type) (m :: Type -> Type) (a :: Type). (m a) -> MonadWriterEffect w m (a, w) 
Pass :: forall (w :: Type) (m :: Type -> Type) (a :: Type). (m (a, w -> w)) -> MonadWriterEffect w m a 

Instances

Instances details
MonadWriter e m => InterpretEffectStateful x m (MonadWriterEffect e) Source #

A "passthough" instance for MonadWriterEffects: Modifications are applied in all nested positions of Listen and Pass, but don't actually change the semantics of any MonadWriterEffect.

Instance details

Defined in Effect.Writer.Passthrough

Methods

interpretEffectStateful :: forall (ops :: [Effect]) x0 a. (forall b y. x y -> AST ops b -> m (b, x y)) -> x x0 -> MonadWriterEffect e (AST ops) a -> m (a, x x0) Source #

((), MonadWriter w m) => InterpretEffect m (MonadWriterEffect w) Source # 
Instance details

Defined in Effect.Writer

Methods

interpretEffect :: forall (ops :: [Effect]) a. (forall b. AST ops b -> m b) -> MonadWriterEffect w (AST ops) a -> m a Source #

Orphan instances

(((), Monoid w), EffectInject (MonadWriterEffect w) ops) => MonadWriter w (AST ops) Source # 
Instance details

Methods

writer :: (a, w) -> AST ops a #

tell :: w -> AST ops () #

listen :: AST ops a -> AST ops (a, w) #

pass :: AST ops (a, w -> w) -> AST ops a #