Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extensions |
|
Synopsis
- class Category c => EffectCategory c m | c -> m where
- effect :: m (c a b) -> c a b
- data EffCat :: (* -> *) -> (k -> k -> *) -> k -> k -> * where
- liftEffect :: (Monad m, FreeAlgebra2 cat, AlgebraType0 cat tr, Category (cat tr)) => tr a b -> EffCat m (cat tr) a b
- foldNatEffCat :: (Monad m, FreeAlgebra2 cat, AlgebraType cat c, AlgebraType0 cat tr, Category (cat tr), EffectCategory c m) => (forall x y. tr x y -> c x y) -> EffCat m (cat tr) a b -> c a b
- liftKleisli :: Applicative m => (a -> b) -> Kleisli m a b
Documentation
class Category c => EffectCategory c m | c -> m where Source #
Categories which can lift monadic actions, i.e. effectful categories.
data EffCat :: (* -> *) -> (k -> k -> *) -> k -> k -> * where Source #
Category transformer, which adds
instance to the
underlying base category.EffectCategory
Instances
Monad m => FreeAlgebra2 (EffCat m :: (k -> k -> Type) -> k -> k -> Type) Source # | |
Defined in Control.Category.FreeEffect liftFree2 :: AlgebraType0 (EffCat m) f => f a b -> EffCat m f a b # foldNatFree2 :: (AlgebraType (EffCat m) d, AlgebraType0 (EffCat m) f) => (forall (x :: k0) (y :: k0). f x y -> d x y) -> EffCat m f a b -> d a b # codom2 :: AlgebraType0 (EffCat m) f => Proof (AlgebraType (EffCat m) (EffCat m f)) (EffCat m f) # forget2 :: AlgebraType (EffCat m) f => Proof (AlgebraType0 (EffCat m) f) (EffCat m f) # | |
(Functor m, Category c) => Category (EffCat m c :: k -> k -> Type) Source # | |
(Functor m, Category c) => EffectCategory (EffCat m c :: k -> k -> Type) m Source # | |
type AlgebraType (EffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) Source # | |
Defined in Control.Category.FreeEffect type AlgebraType (EffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) = EffectCategory c m | |
type AlgebraType0 (EffCat m :: (k2 -> k2 -> Type) -> k2 -> k2 -> Type) (c :: k1 -> k1 -> Type) Source # | |
Defined in Control.Category.FreeEffect |
liftEffect :: (Monad m, FreeAlgebra2 cat, AlgebraType0 cat tr, Category (cat tr)) => tr a b -> EffCat m (cat tr) a b Source #
Wrap a transition into
for any free category EffCat
catcat
(e.g.
Cat
).
foldNatEffCat :: (Monad m, FreeAlgebra2 cat, AlgebraType cat c, AlgebraType0 cat tr, Category (cat tr), EffectCategory c m) => (forall x y. tr x y -> c x y) -> EffCat m (cat tr) a b -> c a b Source #
Fold
category based on a free category FreeLifing
(e.g.
cat
tr
) using a functor Cat
trtr x y -> c x y
.
liftKleisli :: Applicative m => (a -> b) -> Kleisli m a b Source #
Functor from (->)
category to
. If Kleisli
mm
is Identity
then
it will respect effect
i.e.
.liftKleisli
(effect
ar) = effect
(liftKleisli
<$> ar)