free-category-0.0.3.0: Free category

Safe HaskellSafe
LanguageHaskell2010
Extensions
  • MonoLocalBinds
  • TypeFamilies
  • GADTs
  • GADTSyntax
  • PolyKinds
  • TypeSynonymInstances
  • FlexibleInstances
  • ConstrainedClassMethods
  • MultiParamTypeClasses
  • FunctionalDependencies
  • KindSignatures
  • RankNTypes
  • ExplicitNamespaces
  • ExplicitForAll

Control.Category.FreeEff

Synopsis

Documentation

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

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

Methods

lift :: m (c a b) -> c a b Source #

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

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 # 
Instance details

Defined in Control.Category.FreeEff

Methods

lift :: m (Kleisli m a b) -> Kleisli m a b Source #

EffCategory ((->) :: Type -> Type -> Type) Identity Source # 
Instance details

Defined in Control.Category.FreeEff

Methods

lift :: Identity (a -> b) -> a -> b Source #

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

Category transformer, which adds EffCategory instance to the underlying base category.

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 # 
Instance details

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 Cat and then in 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 FreeLifing category based on a free category Cat tr using a functor tr x y -> c x y.

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

Functor from '->' category to Kleisli m. If m is Identity then it will respect lift i.e. @liftKleisli (lift ar) = lift (liftKleisli $ ar).