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 :: (Type -> Type) -> (k -> k -> Type) -> k -> k -> Type 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
- runEffCat :: Monad m => EffCat m c a b -> m (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 :: (Type -> Type) -> (k -> k -> Type) -> k -> k -> Type 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 :: forall f (a :: k0) (b :: k0). AlgebraType0 (EffCat m) f => f a b -> EffCat m f a b # foldNatFree2 :: forall d f (a :: k0) (b :: k0). (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 :: forall (f :: k0 -> k0 -> Type). AlgebraType0 (EffCat m) f => Proof (AlgebraType (EffCat m) (EffCat m f)) (EffCat m f) # forget2 :: forall (f :: k0 -> k0 -> Type). 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 FreeLifting
(e.g.
cat
tr
) using a functor C
trtr x y -> c x y
.
runEffCat :: Monad m => EffCat m c a b -> m (c a b) Source #
Join all effects in a free effectful category EffCat
.
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)