Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

## Synopsis

- class Category c => EffCategory c m | c -> m where
- lift :: m (c a b) -> c a b

- data FreeEffCat :: (* -> *) -> (k -> k -> *) -> k -> k -> * where
- Base :: c a b -> FreeEffCat m c a b
- Lift :: m (FreeEffCat m c a b) -> FreeEffCat m c a b

- liftCat :: Monad m => tr a b -> FreeEffCat m (Cat tr) a b
- foldNatLift :: (Monad m, EffCategory c m) => (forall x y. tr x y -> c x y) -> FreeEffCat m (Cat tr) a b -> c a b
- liftKleisli :: Applicative m => (a -> b) -> Kleisli m a b

# Documentation

class Category c => EffCategory c m | c -> m where Source #

Categories which can lift monadic actions, i.e. effectful categories.

## Instances

(Functor m, Category c) => EffCategory (FreeEffCat m c :: k -> k -> Type) m Source # | |

Defined in Control.Category.FreeEff lift :: m (FreeEffCat m c a b) -> FreeEffCat m c a b Source # | |

Monad m => EffCategory (Kleisli m :: Type -> Type -> Type) m Source # | |

EffCategory ((->) :: Type -> Type -> Type) Identity Source # | |

Defined in Control.Category.FreeEff |

data FreeEffCat :: (* -> *) -> (k -> k -> *) -> k -> k -> * where Source #

Category transformer, which adds

instance to the
underlying base category.`EffCategory`

Base :: c a b -> FreeEffCat m c a b | |

Lift :: m (FreeEffCat m c a b) -> FreeEffCat m c a b |

## Instances

liftCat :: Monad m => tr a b -> FreeEffCat m (Cat tr) a b Source #

Wrap a transition into a free category

and then in
`Cat`

`FreeEffCat`

liftCat tr = Base (tr :.: Id)

foldNatLift :: (Monad m, EffCategory c m) => (forall x y. tr x y -> c x y) -> FreeEffCat m (Cat tr) a b -> c a b Source #

Fold

category based on a free category `FreeLifing`

using
a functor `Cat`

tr`tr x y -> c x y`

.

liftKleisli :: Applicative m => (a -> b) -> Kleisli m a b Source #