Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Extensions |
|
Control.Category.FreeEff
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 Methods 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
Constructors
Base :: c a b -> FreeEffCat m c a b | |
Lift :: m (FreeEffCat m c a b) -> FreeEffCat m c a b |
Instances
Monad m => FreeAlgebra2 (FreeEffCat m :: (k -> k -> Type) -> k -> k -> Type) Source # | |
Defined in Control.Category.FreeEff Methods liftFree2 :: AlgebraType0 (FreeEffCat m) f => f a b -> FreeEffCat m f a b # foldNatFree2 :: (AlgebraType (FreeEffCat m) d, AlgebraType0 (FreeEffCat m) f) => (forall (x :: k0) (y :: k0). f x y -> d x y) -> FreeEffCat m f a b -> d a b # codom2 :: AlgebraType0 (FreeEffCat m) f => Proof (AlgebraType (FreeEffCat m) (FreeEffCat m f)) (FreeEffCat m f) # forget2 :: AlgebraType (FreeEffCat m) f => Proof (AlgebraType0 (FreeEffCat m) f) (FreeEffCat m f) # | |
(Functor m, Category c) => Category (FreeEffCat m c :: k -> k -> Type) Source # | |
Defined in Control.Category.FreeEff Methods id :: FreeEffCat m c a a # (.) :: FreeEffCat m c b c0 -> FreeEffCat m c a b -> FreeEffCat m c a c0 # | |
(Functor m, Category c) => EffCategory (FreeEffCat m c :: k -> k -> Type) m Source # | |
Defined in Control.Category.FreeEff Methods lift :: m (FreeEffCat m c a b) -> FreeEffCat m c a b Source # | |
type AlgebraType (FreeEffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) Source # | |
Defined in Control.Category.FreeEff type AlgebraType (FreeEffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) = EffCategory c m | |
type AlgebraType0 (FreeEffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) Source # | |
Defined in Control.Category.FreeEff type AlgebraType0 (FreeEffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) = (Monad m, Category c) |
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
trtr x y -> c x y
.
liftKleisli :: Applicative m => (a -> b) -> Kleisli m a b Source #