data-effects-core-0.2.0.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2023-2024 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainer[email protected]
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Control.Effect.Key

Description

 
Synopsis

Documentation

class SendFOEBy (key :: k) (ins :: EffectF) (f :: Type -> Type) | key f -> ins where Source #

Methods

sendFOEBy :: ins a -> f a Source #

Instances

Instances details
SendFOEBy key (ins # tag) f => SendFOEBy (key :: k1) ins (ViaTag tag f) Source # 
Instance details

Defined in Control.Effect.Tag

Methods

sendFOEBy :: ins a -> ViaTag tag f a Source #

class SendHOEBy (key :: k) (sig :: EffectH) (f :: Type -> Type) | key f -> sig where Source #

Methods

sendHOEBy :: sig f a -> f a Source #

Instances

Instances details
(SendHOEBy key (sig ## tag) f, HFunctor sig) => SendHOEBy (key :: k1) sig (ViaTag tag f) Source # 
Instance details

Defined in Control.Effect.Tag

Methods

sendHOEBy :: sig (ViaTag tag f) a -> ViaTag tag f a Source #

newtype ByKey (key :: k) (f :: Type -> Type) a Source #

A wrapper data type to represent sending an effect to the carrier f with the specified key.

Constructors

ByKey 

Fields

Instances

Instances details
(MonadReader r f, MonadWriter w f, MonadState s f) => MonadRWS r w s (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

SendFOEBy key ins f => SendFOE ins (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

sendFOE :: ins a -> ByKey key f a Source #

(SendHOEBy key sig f, HFunctor sig) => SendHOE sig (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

sendHOE :: sig (ByKey key f) a -> ByKey key f a Source #

MonadError e f => MonadError e (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

throwError :: e -> ByKey key f a #

catchError :: ByKey key f a -> (e -> ByKey key f a) -> ByKey key f a #

MonadReader r f => MonadReader r (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

ask :: ByKey key f r #

local :: (r -> r) -> ByKey key f a -> ByKey key f a #

reader :: (r -> a) -> ByKey key f a #

MonadState s f => MonadState s (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

get :: ByKey key f s #

put :: s -> ByKey key f () #

state :: (s -> (a, s)) -> ByKey key f a #

MonadWriter w f => MonadWriter w (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

writer :: (a, w) -> ByKey key f a #

tell :: w -> ByKey key f () #

listen :: ByKey key f a -> ByKey key f (a, w) #

pass :: ByKey key f (a, w -> w) -> ByKey key f a #

MonadFail f => MonadFail (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

fail :: String -> ByKey key f a #

MonadFix f => MonadFix (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

mfix :: (a -> ByKey key f a) -> ByKey key f a #

MonadIO f => MonadIO (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

liftIO :: IO a -> ByKey key f a #

Alternative f => Alternative (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

empty :: ByKey key f a #

(<|>) :: ByKey key f a -> ByKey key f a -> ByKey key f a #

some :: ByKey key f a -> ByKey key f [a] #

many :: ByKey key f a -> ByKey key f [a] #

Applicative f => Applicative (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

pure :: a -> ByKey key f a #

(<*>) :: ByKey key f (a -> b) -> ByKey key f a -> ByKey key f b #

liftA2 :: (a -> b -> c) -> ByKey key f a -> ByKey key f b -> ByKey key f c #

(*>) :: ByKey key f a -> ByKey key f b -> ByKey key f b #

(<*) :: ByKey key f a -> ByKey key f b -> ByKey key f a #

Functor f => Functor (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

fmap :: (a -> b) -> ByKey key f a -> ByKey key f b #

(<$) :: a -> ByKey key f b -> ByKey key f a #

Monad f => Monad (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

(>>=) :: ByKey key f a -> (a -> ByKey key f b) -> ByKey key f b #

(>>) :: ByKey key f a -> ByKey key f b -> ByKey key f b #

return :: a -> ByKey key f a #

MonadPlus f => MonadPlus (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

mzero :: ByKey key f a #

mplus :: ByKey key f a -> ByKey key f a -> ByKey key f a #

key :: forall {k} (key :: k) f a. ByKey key f a -> f a Source #

Send all effects within the scope, keyed, to carrier f.