data-effects-0.3.0.1: A basic framework for effect systems based on effects represented by GADTs.
Safe HaskellNone
LanguageGHC2021

Data.Effect.ShiftReset

Documentation

data Shift' ans (n :: Type -> Type) (m :: Type -> Type) a where Source #

Constructors

Shift :: forall ans (n :: Type -> Type) (m :: Type -> Type) a. ((a -> n ans) -> (forall x. m x -> n x) -> n ans) -> Shift' ans n m a 

Instances

Instances details
() => HFunctor (Shift' ans n) Source # 
Instance details

Defined in Data.Effect.ShiftReset

Methods

hfmap :: forall (f :: Type -> Type) (g :: Type -> Type). (f :-> g) -> Shift' ans n f :-> Shift' ans n g #

type Shift ans (n :: Type -> Type) = ShiftKey ##> Shift' ans n Source #

shift'_ :: forall ans n a m. SendHOE (Shift' ans n) m => ((a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

shift' :: forall {k} (tag :: k) ans n a m. SendHOE (TagH (Shift' ans n) tag) m => ((a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

shift'' :: forall {k} (key :: k) ans n a m. SendHOEBy key (Shift' ans n) m => ((a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

shift :: forall ans n a m. SendHOEBy ShiftKey (Shift' ans n) m => ((a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

callCC :: forall a m ans n. (SendHOEBy ShiftKey (Shift' ans n) m, Monad m, Monad n) => ((a -> n ans) -> m a) -> m a Source #

exit :: forall a m ans (n :: Type -> Type). (SendHOEBy ShiftKey (Shift' ans n) m, Applicative n) => ans -> m a Source #

getCC :: forall m ans n. (SendHOEBy ShiftKey (Shift' ans n) m, Monad m, Monad n) => m (n ans) Source #

embed :: forall (m :: Type -> Type) ans (n :: Type -> Type). (SendHOEBy ShiftKey (Shift' ans n) m, Monad n) => n ~> m Source #

data Shift_' (n :: Type -> Type) (m :: Type -> Type) a where Source #

Constructors

Shift_' :: forall a (n :: Type -> Type) (m :: Type -> Type). (forall ans. (a -> n ans) -> (forall x. m x -> n x) -> n ans) -> Shift_' n m a 

Instances

Instances details
() => HFunctor (Shift_' n) Source # 
Instance details

Defined in Data.Effect.ShiftReset

Methods

hfmap :: forall (f :: Type -> Type) (g :: Type -> Type). (f :-> g) -> Shift_' n f :-> Shift_' n g #

shift_''_ :: forall a n m. SendHOE (Shift_' n) m => (forall ans. (a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

shift_'' :: forall {k} (tag :: k) a n m. SendHOE (TagH (Shift_' n) tag) m => (forall ans. (a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

shift_''' :: forall {k} (key :: k) a n m. SendHOEBy key (Shift_' n) m => (forall ans. (a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

shift_' :: forall a n m. SendHOEBy Shift_Key (Shift_' n) m => (forall ans. (a -> n ans) -> (forall x. m x -> n x) -> n ans) -> m a Source #

getCC_ :: forall m n. (SendHOEBy Shift_Key (Shift_' n) m, Functor n) => m (n ()) Source #

data Reset (m :: Type -> Type) a where Source #

Constructors

Reset :: forall (m :: Type -> Type) a. m a -> Reset m a 

Instances

Instances details
() => HFunctor Reset Source # 
Instance details

Defined in Data.Effect.ShiftReset

Methods

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

reset :: forall a m. SendHOE Reset m => m a -> m a Source #

reset' :: forall {k} (tag :: k) a m. SendHOE (TagH Reset tag) m => m a -> m a Source #

reset'' :: forall {k} (key :: k) a m. SendHOEBy key Reset m => m a -> m a Source #

data ShiftF ans a where Source #

Constructors

ShiftF :: forall ans a. ((a -> ans) -> ans) -> ShiftF ans a 

type LShiftF ans = LiftFOE (ShiftF ans) Source #

pattern LShiftF :: forall a ans f a1. () => (a ~ a1, ()) => ((a1 -> ans) -> ans) -> LiftFOE (ShiftF ans) f a Source #

shiftF :: forall ans a f. SendFOE (ShiftF ans) f => ((a -> ans) -> ans) -> f a Source #

shiftF' :: forall {k} (tag :: k) ans a f. SendFOE (Tag (ShiftF ans) tag) f => ((a -> ans) -> ans) -> f a Source #

shiftF'' :: forall {k} (key :: k) ans a f. SendFOEBy key (ShiftF ans) f => ((a -> ans) -> ans) -> f a Source #

fromShiftF :: forall n ans (m :: Type -> Type) x. ShiftF (n ans) x -> Shift ans n m x Source #

exitF :: ShiftF ans <: m => ans -> m a Source #

embedF :: forall ans (n :: Type -> Type) (m :: Type -> Type). (ShiftF (n ans) <: m, Monad n) => n ~> m Source #