Copyright | (c) 2023 Yamada Ryo |
---|---|
License | MPL-2.0 (see the file LICENSE) |
Maintainer | ymdfield@outlook.jp |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
A type class to abstract away the encoding details of the Freer carriers.
Synopsis
- class (forall ins. c (f ins)) => Freer c f | f -> c where
- liftIns :: ins a -> f ins a
- interpretF :: c m => (ins ~> m) -> f ins a -> m a
- retract :: c m => f m a -> m a
- transformF :: (ins ~> ins') -> f ins a -> f ins' a
- reinterpretF :: (ins ~> f ins) -> f ins a -> f ins a
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.
liftIns, (interpretF | retract, transformF)
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
Freer Applicative Ap Source # | |
Defined in Control.Freer 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 # | |
Defined in Control.Freer 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 # | |
Defined in Control.Monad.Trans.Freer.Tree 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 # |