Copyright | (c) Mario Román 2020 |
---|---|
License | GPL-3 |
Maintainer | mromang08@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Provides a definition of category enriched over Hask, where the sets of objects are represented by constraints. Considers also functors and monoidal categories.
Synopsis
- class Category objc c where
- class (Category objc c, Category objd d, forall x. objc x => objd (f x)) => VFunctor objc c objd d f where
- map :: (objc x, objc y) => c x y -> d (f x) (f y)
- class (Category objc c, Category objd d, Category obje e, forall x y. (objc x, objd y) => obje (f x y)) => Bifunctor objc c objd d obje e f where
- bimap :: (objc x1, objc x2, objd y1, objd y2) => c x1 x2 -> d y1 y2 -> e (f x1 y1) (f x2 y2)
- class (Category objc c, Category objd d) => Profunctor objc c objd d p where
- dimap :: (objc x1, objc x2, objd y1, objd y2) => c x2 x1 -> d y1 y2 -> p x1 y1 -> p x2 y2
- class (Category obja a, Bifunctor obja a obja a obja a o, obja i) => MonoidalCategory obja a o i where
- class (MonoidalCategory objm m o i, Bifunctor objm m objc c objc c f, Category objc c) => MonoidalAction objm m o i objc c f where
- unitor :: objc x => c (f i x) x
- unitorinv :: objc x => c x (f i x)
- multiplicator :: (objc x, objm p, objm q) => c (f p (f q x)) (f (p `o` q) x)
- multiplicatorinv :: (objc x, objm p, objm q) => c (f (p `o` q) x) (f p (f q x))
Documentation
class Category objc c where Source #
Definition of a category enriched over the language. The sets of objects are represented by constraints.
Instances
Monad m => Category (Algebra m :: Type -> Constraint) ((->) :: Type -> Type -> Type) Source # | |
Category (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) Source # | |
Monad m => Category (Any :: Type -> Constraint) (Kleisli m :: Type -> Type -> Type) Source # | |
Category Functor (Nat :: (Type -> Type) -> (Type -> Type) -> Type) Source # | |
Category Applicative (Nat :: (Type -> Type) -> (Type -> Type) -> Type) Source # | |
Defined in CategoriesInstances | |
Category Traversable (Nat :: (Type -> Type) -> (Type -> Type) -> Type) Source # | |
Defined in CategoriesInstances |
class (Category objc c, Category objd d, forall x. objc x => objd (f x)) => VFunctor objc c objd d f where Source #
Functors.
class (Category objc c, Category objd d, Category obje e, forall x y. (objc x, objd y) => obje (f x y)) => Bifunctor objc c objd d obje e f where Source #
Bifunctors.
bimap :: (objc x1, objc x2, objd y1, objd y2) => c x1 x2 -> d y1 y2 -> e (f x1 y1) (f x2 y2) Source #
Instances
class (Category objc c, Category objd d) => Profunctor objc c objd d p where Source #
Profunctors.
Instances
(MonoidalAction objm m o i objc c f, MonoidalAction objm m o i objd d g, objc a, objd b) => Profunctor (objc :: k2 -> Constraint) (c :: k2 -> k2 -> Type) (objd :: k1 -> Constraint) (d :: k1 -> k1 -> Type) (Optic objc c objd d objm m o i f g a b :: k2 -> k1 -> Type) Source # | |
Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Replacing a b :: Type -> Type -> Type) Source # | |
Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Aggregating a b :: Type -> Type -> Type) Source # | |
Defined in Combinators dimap :: (Any x1, Any x2, Any y1, Any y2) => (x2 -> x1) -> (y1 -> y2) -> Aggregating a b x1 y1 -> Aggregating a b x2 y2 Source # | |
Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Setting a b :: Type -> Type -> Type) Source # | |
Monad m => Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Updating m a b :: Type -> Type -> Type) Source # | |
Monad m => Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Classifying m a b :: Type -> Type -> Type) Source # | |
Defined in Combinators dimap :: (Any x1, Any x2, Any y1, Any y2) => (x2 -> x1) -> (y1 -> y2) -> Classifying m a b x1 y1 -> Classifying m a b x2 y2 Source # | |
Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Previewing a b :: Type -> Type -> Type) Source # | |
Defined in Combinators dimap :: (Any x1, Any x2, Any y1, Any y2) => (x2 -> x1) -> (y1 -> y2) -> Previewing a b x1 y1 -> Previewing a b x2 y2 Source # | |
Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Viewing a b :: Type -> Type -> Type) Source # | |
Monad m => Profunctor (Any :: Type -> Constraint) ((->) :: Type -> Type -> Type) (Any :: Type -> Constraint) (Kleisli m :: Type -> Type -> Type) (Updating m a b :: Type -> Type -> Type) Source # | |
class (Category obja a, Bifunctor obja a obja a obja a o, obja i) => MonoidalCategory obja a o i where Source #
Monoidal categories. The definition follows that of an enriched monoidal category, taking the language as the base of enrichment.
alpha :: (obja x, obja y, obja z) => a (x `o` (y `o` z)) ((x `o` y) `o` z) Source #
alphainv :: (obja x, obja y, obja z) => a ((x `o` y) `o` z) (x `o` (y `o` z)) Source #
lambda :: obja x => a (x `o` i) x Source #
lambdainv :: obja x => a x (x `o` i) Source #
Instances
class (MonoidalCategory objm m o i, Bifunctor objm m objc c objc c f, Category objc c) => MonoidalAction objm m o i objc c f where Source #
Monoidal actions as suitable bifunctors with the corresponding structure maps.
unitor :: objc x => c (f i x) x Source #
unitorinv :: objc x => c x (f i x) Source #
multiplicator :: (objc x, objm p, objm q) => c (f p (f q x)) (f (p `o` q) x) Source #
multiplicatorinv :: (objc x, objm p, objm q) => c (f (p `o` q) x) (f p (f q x)) Source #