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

Control.Effect.Key

Description

 
Synopsis

Documentation

class SendInsBy key (ins :: InsClass) f | key f -> ins where Source #

Methods

sendInsBy :: ins a -> f a Source #

Instances

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

Defined in Control.Effect.Tag

Methods

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

class SendSigBy key (sig :: SigClass) f | key f -> sig where Source #

Methods

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

Instances

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

Defined in Control.Effect.Tag

Methods

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

newtype ByKey key (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

SendInsBy key ins f => SendIns ins (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

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

(SendSigBy key sig f, HFunctor sig) => SendSig sig (ByKey key f) Source # 
Instance details

Defined in Control.Effect.Key

Methods

sendSig :: 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 key f a. ByKey key f a -> f a Source #

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