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.Reader

Description

 

Documentation

data Ask r a where Source #

Constructors

Ask :: forall r. Ask r r 

data Local r (f :: Type -> Type) a where Source #

Constructors

Local :: forall r (f :: Type -> Type) a. (r -> r) -> f a -> Local r f a 

Instances

Instances details
() => HFunctor (Local r) Source # 
Instance details

Defined in Data.Effect.Reader

Methods

hfmap :: forall (f :: Type -> Type) (g :: Type -> Type). (f :-> g) -> Local r f :-> Local r g #

type LAsk r = LiftFOE (Ask r) Source #

pattern LAsk :: forall a r f. () => (a ~ r, ()) => LiftFOE (Ask r) f a Source #

ask :: SendFOE (Ask r) f => f r Source #

ask' :: forall {k} (tag :: k) r f. SendFOE (Tag (Ask r) tag) f => f r Source #

ask'' :: forall {k} (key :: k) r f. SendFOEBy key (Ask r) f => f r Source #

local :: forall r a f. SendHOE (Local r) f => (r -> r) -> f a -> f a Source #

local' :: forall {k} (tag :: k) r a f. SendHOE (TagH (Local r) tag) f => (r -> r) -> f a -> f a Source #

local'' :: forall {k} (key :: k) r a f. SendHOEBy key (Local r) f => (r -> r) -> f a -> f a Source #

asks :: (Ask r <: f, Functor f) => (r -> a) -> f a Source #