data-effects-0.1.1.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Effect.Writer

Description

 

Documentation

data Tell w a where Source #

Constructors

Tell :: w -> Tell w () 

data WriterH w f a where Source #

Constructors

Listen :: f a -> WriterH w f (w, a) 
Censor :: (w -> w) -> f a -> WriterH w f a 

Instances

Instances details
() => HFunctor (WriterH w) Source # 
Instance details

Defined in Data.Effect.Writer

Methods

hfmap :: forall (f :: Type -> Type) (g :: Type -> Type). (f :-> g) -> WriterH w f :-> WriterH w g #

type LTell w = LiftIns (Tell w) Source #

censor'' :: forall key (w :: Type) (a :: Type) f. SendSigBy key (WriterH w) f => (w -> w) -> f a -> f a Source #

censor' :: forall tag (w :: Type) (a :: Type) f. SendSig (TagH (WriterH w) tag) f => (w -> w) -> f a -> f a Source #

censor :: forall (w :: Type) (a :: Type) f. SendSig (WriterH w) f => (w -> w) -> f a -> f a Source #

listen'' :: forall key (a :: Type) (w :: Type) f. SendSigBy key (WriterH w) f => f a -> f (w, a) Source #

listen' :: forall tag (a :: Type) (w :: Type) f. SendSig (TagH (WriterH w) tag) f => f a -> f (w, a) Source #

listen :: forall (a :: Type) (w :: Type) f. SendSig (WriterH w) f => f a -> f (w, a) Source #

pattern LTell :: () => (a ~ (), ()) => w -> LiftIns (Tell w) f a Source #

tell'' :: forall key (w :: Type) f. SendInsBy key (Tell w) f => w -> f () Source #

tell' :: forall tag (w :: Type) f. SendIns (Tag (Tell w) tag) f => w -> f () Source #

tell :: forall (w :: Type) f. SendIns (Tell w) f => w -> f () Source #

pass :: (Tell w <: m, WriterH w <<: m, Monad m) => m (w -> w, a) -> m a Source #