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

Description

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

Synopsis

Documentation

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

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

Minimal complete definition

liftIns, (interpretF | retract, transformF)

Methods

liftIns :: ins a -> f ins a Source #

Lift a instruction into a Freer carrier.

interpretF :: c m => (ins ~> m) -> f ins a -> m a Source #

retract :: c m => f m a -> m a Source #

transformF :: (ins ~> ins') -> f ins a -> f ins' a Source #

Translate instructions embedded in a Freer carrier.

reinterpretF :: (ins ~> f ins) -> f ins a -> f ins a Source #

Instances

Instances details
Freer Applicative Ap Source # 
Instance details

Defined in Control.Freer

Methods

liftIns :: forall ins (a :: k). ins a -> Ap ins a Source #

interpretF :: forall m (ins :: k -> Type) (a :: k). Applicative m => (ins ~> m) -> Ap ins a -> m a Source #

retract :: forall m (a :: k). Applicative m => Ap m a -> m a Source #

transformF :: forall (ins :: k -> Type) (ins' :: k -> Type) (a :: k). (ins ~> ins') -> Ap ins a -> Ap ins' a Source #

reinterpretF :: forall (ins :: k -> Type) (a :: k). (ins ~> Ap ins) -> Ap ins a -> Ap ins a Source #

Freer Functor Coyoneda Source # 
Instance details

Defined in Control.Freer

Methods

liftIns :: forall ins (a :: k). ins a -> Coyoneda ins a Source #

interpretF :: forall m (ins :: k -> Type) (a :: k). Functor m => (ins ~> m) -> Coyoneda ins a -> m a Source #

retract :: forall m (a :: k). Functor m => Coyoneda m a -> m a Source #

transformF :: forall (ins :: k -> Type) (ins' :: k -> Type) (a :: k). (ins ~> ins') -> Coyoneda ins a -> Coyoneda ins' a Source #

reinterpretF :: forall (ins :: k -> Type) (a :: k). (ins ~> Coyoneda ins) -> Coyoneda ins a -> Coyoneda ins a Source #

Freer Monad FreerTree Source # 
Instance details

Defined in Control.Monad.Trans.Freer.Tree

Methods

liftIns :: forall ins (a :: k). ins a -> FreerTree ins a Source #

interpretF :: forall m (ins :: k -> Type) (a :: k). Monad m => (ins ~> m) -> FreerTree ins a -> m a Source #

retract :: forall m (a :: k). Monad m => FreerTree m a -> m a Source #

transformF :: forall (ins :: k -> Type) (ins' :: k -> Type) (a :: k). (ins ~> ins') -> FreerTree ins a -> FreerTree ins' a Source #

reinterpretF :: forall (ins :: k -> Type) (a :: k). (ins ~> FreerTree ins) -> FreerTree ins a -> FreerTree ins a Source #