heftia-0.1.0.0: Higher-order version of Freer.
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Freer.Trans

Description

A type class to abstract away the encoding details of the Freer carrier transformers.

Synopsis

Documentation

class (forall ins f. c f => c (fr ins f)) => TransFreer c fr | fr -> c where Source #

A type class to abstract away the encoding details of the Freer carrier transformers.

Minimal complete definition

liftInsT, liftLowerFT, (hoistFreer, runInterpretF | interpretFT)

Methods

liftInsT :: ins ~> fr ins f Source #

Lift a instruction into a Freer carrier transformer.

liftLowerFT :: forall ins f. c f => f ~> fr ins f Source #

transformT :: c f => (ins ~> ins') -> fr ins f ~> fr ins' f Source #

Translate instructions embedded in a Freer carrier transformer.

hoistFreer :: (c f, c g) => (f ~> g) -> fr ins f ~> fr ins g Source #

Translate an underlying carrier.

interposeLowerT :: (c f, c g) => (f ~> fr ins g) -> fr ins f ~> fr ins g Source #

runInterpretF :: c f => (ins ~> f) -> fr ins f a -> f a Source #

default runInterpretF :: (c f, c (IdentityT f)) => (ins ~> f) -> fr ins f a -> f a Source #

interpretFT :: (c f, c g) => (f ~> g) -> (ins ~> g) -> fr ins f ~> g Source #

reinterpretFT :: c f => (ins ~> fr ins f) -> fr ins f ~> fr ins f Source #

Instances

Instances details
TransFreer Monad (FreerChurchT :: Instruction -> (Type -> Type) -> Type -> TYPE LiftedRep) Source # 
Instance details

Defined in Control.Monad.Trans.Freer.Church

Methods

liftInsT :: forall (ins :: k -> Type) (f :: k -> Type). ins ~> FreerChurchT ins f Source #

liftLowerFT :: forall (ins :: k -> Type) (f :: k -> Type). Monad f => f ~> FreerChurchT ins f Source #

transformT :: forall (f :: k -> Type) (ins :: k -> Type) (ins' :: k -> Type). Monad f => (ins ~> ins') -> FreerChurchT ins f ~> FreerChurchT ins' f Source #

hoistFreer :: forall (f :: k -> Type) (g :: k -> Type) (ins :: k -> Type). (Monad f, Monad g) => (f ~> g) -> FreerChurchT ins f ~> FreerChurchT ins g Source #

interposeLowerT :: forall (f :: k -> Type) (g :: k -> Type) (ins :: k -> Type). (Monad f, Monad g) => (f ~> FreerChurchT ins g) -> FreerChurchT ins f ~> FreerChurchT ins g Source #

runInterpretF :: forall f (ins :: k -> Type) (a :: k). Monad f => (ins ~> f) -> FreerChurchT ins f a -> f a Source #

interpretFT :: forall (f :: k -> Type) (g :: k -> Type) (ins :: k -> Type). (Monad f, Monad g) => (f ~> g) -> (ins ~> g) -> FreerChurchT ins f ~> g Source #

reinterpretFT :: forall (f :: k -> Type) (ins :: k -> Type). Monad f => (ins ~> FreerChurchT ins f) -> FreerChurchT ins f ~> FreerChurchT ins f Source #

mergeFreer :: forall fr m ins ins' c. (TransFreer c fr, c m) => fr ins (fr ins' m) ~> fr (ins + ins') m Source #

splitFreer :: forall fr m ins ins' c. (TransFreer c fr, c m) => fr (ins + ins') m ~> fr ins (fr ins' m) Source #