data-effects-0.2.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Data.Effect.Writer

Description

 

Documentation

data Tell w a where Source #

Constructors

Tell :: forall w. w -> Tell w () 

data WriterH w (f :: Type -> Type) a where Source #

Constructors

Listen :: forall (f :: Type -> Type) a1 w. f a1 -> WriterH w f (w, a1) 
Censor :: forall w (f :: Type -> Type) a. (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 = LiftFOE (Tell w) Source #

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

tell :: SendFOE (Tell w) f => w -> f () Source #

tell' :: forall {k} (tag :: k) w f. SendFOE (Tag (Tell w) tag) f => w -> f () Source #

tell'' :: forall {k} (key :: k) w f. SendFOEBy key (Tell w) f => w -> f () Source #

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

listen' :: forall {k} (tag :: k) a w f. SendHOE (TagH (WriterH w) tag) f => f a -> f (w, a) Source #

listen'' :: forall {k} (key :: k) a w f. SendHOEBy key (WriterH w) f => f a -> f (w, a) Source #

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

censor' :: forall {k} (tag :: k) w a f. SendHOE (TagH (WriterH w) tag) f => (w -> w) -> f a -> f a Source #

censor'' :: forall {k} (key :: k) w a f. SendHOEBy key (WriterH w) f => (w -> w) -> f a -> f a Source #

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