classy-effects-0.1.0.0: An interface for a handler-independent, typeclass-based effect system.
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Effect.Class.Writer

Description

 

Documentation

class Monoid w => Tell w f where Source #

Methods

tell :: w -> f () Source #

Instances

Instances details
(SendIns (TellI w) f, Monoid w) => Tell w (EffectsVia EffectDataHandler f) Source # 
Instance details

Defined in Control.Effect.Class.Writer

class Monoid w => WriterH w f where Source #

Methods

listen :: f a -> f (a, w) Source #

censor :: (w -> w) -> f a -> f a Source #

Instances

Instances details
(SendSig (WriterS w) f, Monoid w) => WriterH w (EffectsVia EffectDataHandler f) Source # 
Instance details

Defined in Control.Effect.Class.Writer

data TellI (w :: Type) (a :: Type) where Source #

Constructors

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

type TellS w = LiftIns (TellI w) Source #

data WriterS (w :: Type) f (a :: Type) where Source #

Constructors

Listen :: forall w f a. (f a) -> WriterS w f (a, w) 
Censor :: forall w f a. (w -> w) -> (f a) -> WriterS w f a 

Instances

Instances details
HFunctor (WriterS w) Source # 
Instance details

Defined in Control.Effect.Class.Writer

Methods

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

class (Tell w f, WriterH w f) => Writer w (f :: Type -> Type) Source #

Instances

Instances details
(Tell w (EffectsVia EffectDataHandler f), WriterH w (EffectsVia EffectDataHandler f)) => Writer w (EffectsVia EffectDataHandler f) Source # 
Instance details

Defined in Control.Effect.Class.Writer

pattern TellS :: () => a_6989586621679047924 ~ () => w -> LiftIns (TellI w) f a_6989586621679047924 Source #