License | BSD-style (see the file LICENSE) |
---|---|
Maintainer | sjoerd@w3future.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Diag :: (* -> * -> *) -> (* -> * -> *) -> * where
- type DiagF f = Diag (Dom f) (Cod f)
- type Cone f n = Nat (Dom f) (Cod f) (ConstF f n) f
- type Cocone f n = Nat (Dom f) (Cod f) f (ConstF f n)
- coneVertex :: Cone f n -> Obj (Cod f) n
- coconeVertex :: Cocone f n -> Obj (Cod f) n
- type family LimitFam (j :: * -> * -> *) (k :: * -> * -> *) (f :: *) :: *
- type Limit f = LimitFam (Dom f) (Cod f) f
- class (Category j, Category k) => HasLimits j k where
- data LimitFunctor (j :: * -> * -> *) (k :: * -> * -> *) = LimitFunctor
- limitAdj :: forall j k. HasLimits j k => Adjunction (Nat j k) k (Diag j k) (LimitFunctor j k)
- rightAdjointPreservesLimits :: (HasLimits j c, HasLimits j d) => Adjunction c d f g -> Obj (Nat j c) t -> d (Limit (g :.: t)) (g :% Limit t)
- rightAdjointPreservesLimitsInv :: (HasLimits j c, HasLimits j d) => Obj (Nat c d) g -> Obj (Nat j c) t -> d (g :% Limit t) (Limit (g :.: t))
- type family ColimitFam (j :: * -> * -> *) (k :: * -> * -> *) (f :: *) :: *
- type Colimit f = ColimitFam (Dom f) (Cod f) f
- class (Category j, Category k) => HasColimits j k where
- data ColimitFunctor (j :: * -> * -> *) (k :: * -> * -> *) = ColimitFunctor
- colimitAdj :: forall j k. HasColimits j k => Adjunction k (Nat j k) (ColimitFunctor j k) (Diag j k)
- leftAdjointPreservesColimits :: (HasColimits j c, HasColimits j d) => Adjunction c d f g -> Obj (Nat j d) t -> c (f :% Colimit t) (Colimit (f :.: t))
- leftAdjointPreservesColimitsInv :: (HasColimits j c, HasColimits j d) => Obj (Nat d c) f -> Obj (Nat j d) t -> c (Colimit (f :.: t)) (f :% Colimit t)
- class Category k => HasTerminalObject k where
- type TerminalObject k :: *
- terminalObject :: Obj k (TerminalObject k)
- terminate :: Obj k a -> k a (TerminalObject k)
- class Category k => HasInitialObject k where
- type InitialObject k :: *
- initialObject :: Obj k (InitialObject k)
- initialize :: Obj k a -> k (InitialObject k) a
- data Zero
- class Category k => HasBinaryProducts k where
- type BinaryProduct (k :: * -> * -> *) x y :: *
- proj1 :: Obj k x -> Obj k y -> k (BinaryProduct k x y) x
- proj2 :: Obj k x -> Obj k y -> k (BinaryProduct k x y) y
- (&&&) :: k a x -> k a y -> k a (BinaryProduct k x y)
- (***) :: k a1 b1 -> k a2 b2 -> k (BinaryProduct k a1 a2) (BinaryProduct k b1 b2)
- data ProductFunctor (k :: * -> * -> *) = ProductFunctor
- data p :*: q where
- prodAdj :: HasBinaryProducts k => Adjunction (k :**: k) k (DiagProd k) (ProductFunctor k)
- class Category k => HasBinaryCoproducts k where
- type BinaryCoproduct (k :: * -> * -> *) x y :: *
- inj1 :: Obj k x -> Obj k y -> k x (BinaryCoproduct k x y)
- inj2 :: Obj k x -> Obj k y -> k y (BinaryCoproduct k x y)
- (|||) :: k x a -> k y a -> k (BinaryCoproduct k x y) a
- (+++) :: k a1 b1 -> k a2 b2 -> k (BinaryCoproduct k a1 a2) (BinaryCoproduct k b1 b2)
- data CoproductFunctor (k :: * -> * -> *) = CoproductFunctor
- data p :+: q where
- coprodAdj :: HasBinaryCoproducts k => Adjunction k (k :**: k) (CoproductFunctor k) (DiagProd k)
Preliminairies
Diagonal Functor
data Diag :: (* -> * -> *) -> (* -> * -> *) -> * where Source #
type DiagF f = Diag (Dom f) (Cod f) Source #
The diagonal functor with the same domain and codomain as f
.
Cones
type Cone f n = Nat (Dom f) (Cod f) (ConstF f n) f Source #
A cone from N to F is a natural transformation from the constant functor to N to F.
type Cocone f n = Nat (Dom f) (Cod f) f (ConstF f n) Source #
A co-cone from F to N is a natural transformation from F to the constant functor to N.
Limits
type family LimitFam (j :: * -> * -> *) (k :: * -> * -> *) (f :: *) :: * Source #
Limits in a category k
by means of a diagram of type j
, which is a functor from j
to k
.
Instances
type LimitFam Unit k f Source # | |
Defined in Data.Category.Limit | |
type LimitFam Void k f Source # | |
Defined in Data.Category.Limit | |
type LimitFam Boolean k f Source # | |
Defined in Data.Category.Boolean | |
type LimitFam (i :>>: j) k f Source # | |
Defined in Data.Category.Limit | |
type LimitFam (i :++: j) k f Source # | |
Defined in Data.Category.Limit | |
type LimitFam ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) f Source # | |
Defined in Data.Category.Limit type LimitFam ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) f |
class (Category j, Category k) => HasLimits j k where Source #
An instance of HasLimits j k
says that k
has all limits of type j
.
limit :: Obj (Nat j k) f -> Cone f (Limit f) Source #
limit
returns the limiting cone for a functor f
.
limitFactorizer :: Obj (Nat j k) f -> Cone f n -> k n (Limit f) Source #
limitFactorizer
shows that the limiting cone is universal – i.e. any other cone of f
factors through it
by returning the morphism between the vertices of the cones.
Instances
Category k => HasLimits Unit k Source # | The limit of a single object is that object. |
HasTerminalObject k => HasLimits Void k Source # | A terminal object is the limit of the functor from 0 to k. |
Category k => HasLimits Boolean k Source # | The limit of a functor from the Boolean category is the source of the arrow it points to. |
(HasInitialObject (i :>>: j), Category k) => HasLimits (i :>>: j) k Source # | The limit of any diagram with an initial object, has the limit at the initial object. |
(HasLimits i k, HasLimits j k, HasBinaryProducts k) => HasLimits (i :++: j) k Source # | If |
HasLimits ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) Source # | |
data LimitFunctor (j :: * -> * -> *) (k :: * -> * -> *) Source #
Instances
HasLimits j k => Functor (LimitFunctor j k) Source # | If every diagram of type |
Defined in Data.Category.Limit type Dom (LimitFunctor j k) :: Type -> Type -> Type Source # type Cod (LimitFunctor j k) :: Type -> Type -> Type Source # type (LimitFunctor j k) :% a :: Type Source # (%) :: LimitFunctor j k -> Dom (LimitFunctor j k) a b -> Cod (LimitFunctor j k) (LimitFunctor j k :% a) (LimitFunctor j k :% b) Source # | |
type Dom (LimitFunctor j k) Source # | |
Defined in Data.Category.Limit | |
type Cod (LimitFunctor j k) Source # | |
Defined in Data.Category.Limit | |
type (LimitFunctor j k) :% f Source # | |
Defined in Data.Category.Limit |
limitAdj :: forall j k. HasLimits j k => Adjunction (Nat j k) k (Diag j k) (LimitFunctor j k) Source #
The limit functor is right adjoint to the diagonal functor.
rightAdjointPreservesLimits :: (HasLimits j c, HasLimits j d) => Adjunction c d f g -> Obj (Nat j c) t -> d (Limit (g :.: t)) (g :% Limit t) Source #
rightAdjointPreservesLimitsInv :: (HasLimits j c, HasLimits j d) => Obj (Nat c d) g -> Obj (Nat j c) t -> d (g :% Limit t) (Limit (g :.: t)) Source #
Colimits
type family ColimitFam (j :: * -> * -> *) (k :: * -> * -> *) (f :: *) :: * Source #
Colimits in a category k
by means of a diagram of type j
, which is a functor from j
to k
.
Instances
type ColimitFam Unit k f Source # | |
Defined in Data.Category.Limit | |
type ColimitFam Void k f Source # | |
Defined in Data.Category.Limit | |
type ColimitFam Boolean k f Source # | |
Defined in Data.Category.Boolean | |
type ColimitFam (i :>>: j) k f Source # | |
Defined in Data.Category.Limit | |
type ColimitFam (i :++: j) k f Source # | |
Defined in Data.Category.Limit type ColimitFam (i :++: j) k f = BinaryCoproduct k (ColimitFam i k (f :.: Inj1 i j)) (ColimitFam j k (f :.: Inj2 i j)) | |
type ColimitFam ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) f Source # | |
Defined in Data.Category.Limit type ColimitFam ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) f |
class (Category j, Category k) => HasColimits j k where Source #
An instance of HasColimits j k
says that k
has all colimits of type j
.
colimit :: Obj (Nat j k) f -> Cocone f (Colimit f) Source #
colimit
returns the limiting co-cone for a functor f
.
colimitFactorizer :: Obj (Nat j k) f -> Cocone f n -> k (Colimit f) n Source #
colimitFactorizer
shows that the limiting co-cone is universal – i.e. any other co-cone of f
factors through it
by returning the morphism between the vertices of the cones.
Instances
Category k => HasColimits Unit k Source # | The colimit of a single object is that object. |
HasInitialObject k => HasColimits Void k Source # | An initial object is the colimit of the functor from 0 to k. |
Category k => HasColimits Boolean k Source # | The colimit of a functor from the Boolean category is the target of the arrow it points to. |
(HasTerminalObject (i :>>: j), Category k) => HasColimits (i :>>: j) k Source # | The colimit of any diagram with a terminal object, has the limit at the terminal object. |
(HasColimits i k, HasColimits j k, HasBinaryCoproducts k) => HasColimits (i :++: j) k Source # | If |
HasColimits ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) Source # | |
data ColimitFunctor (j :: * -> * -> *) (k :: * -> * -> *) Source #
Instances
HasColimits j k => Functor (ColimitFunctor j k) Source # | If every diagram of type |
Defined in Data.Category.Limit type Dom (ColimitFunctor j k) :: Type -> Type -> Type Source # type Cod (ColimitFunctor j k) :: Type -> Type -> Type Source # type (ColimitFunctor j k) :% a :: Type Source # (%) :: ColimitFunctor j k -> Dom (ColimitFunctor j k) a b -> Cod (ColimitFunctor j k) (ColimitFunctor j k :% a) (ColimitFunctor j k :% b) Source # | |
type Dom (ColimitFunctor j k) Source # | |
Defined in Data.Category.Limit | |
type Cod (ColimitFunctor j k) Source # | |
Defined in Data.Category.Limit | |
type (ColimitFunctor j k) :% f Source # | |
Defined in Data.Category.Limit |
colimitAdj :: forall j k. HasColimits j k => Adjunction k (Nat j k) (ColimitFunctor j k) (Diag j k) Source #
The colimit functor is left adjoint to the diagonal functor.
leftAdjointPreservesColimits :: (HasColimits j c, HasColimits j d) => Adjunction c d f g -> Obj (Nat j d) t -> c (f :% Colimit t) (Colimit (f :.: t)) Source #
leftAdjointPreservesColimitsInv :: (HasColimits j c, HasColimits j d) => Obj (Nat d c) f -> Obj (Nat j d) t -> c (Colimit (f :.: t)) (f :% Colimit t) Source #
Limits of type Void
class Category k => HasTerminalObject k where Source #
type TerminalObject k :: * Source #
terminalObject :: Obj k (TerminalObject k) Source #
terminate :: Obj k a -> k a (TerminalObject k) Source #
Instances
class Category k => HasInitialObject k where Source #
type InitialObject k :: * Source #
initialObject :: Obj k (InitialObject k) Source #
initialize :: Obj k a -> k (InitialObject k) a Source #
Instances
HasInitialObject Cat Source # | The empty category is the initial object in |
Defined in Data.Category.Limit type InitialObject Cat :: Type Source # initialObject :: Obj Cat (InitialObject Cat) Source # initialize :: Obj Cat a -> Cat (InitialObject Cat) a Source # | |
HasInitialObject Unit Source # | The category of one object has that object as initial object. |
Defined in Data.Category.Limit type InitialObject Unit :: Type Source # initialObject :: Obj Unit (InitialObject Unit) Source # initialize :: Obj Unit a -> Unit (InitialObject Unit) a Source # | |
HasInitialObject Simplex Source # | The ordinal |
Defined in Data.Category.Simplex type InitialObject Simplex :: Type Source # initialObject :: Obj Simplex (InitialObject Simplex) Source # initialize :: Obj Simplex a -> Simplex (InitialObject Simplex) a Source # | |
HasInitialObject Boolean Source # | False is the initial object in the Boolean category. |
Defined in Data.Category.Boolean type InitialObject Boolean :: Type Source # initialObject :: Obj Boolean (InitialObject Boolean) Source # initialize :: Obj Boolean a -> Boolean (InitialObject Boolean) a Source # | |
HasTerminalObject k => HasInitialObject (Op k) Source # | Terminal objects are the dual of initial objects. |
Defined in Data.Category.Limit type InitialObject (Op k) :: Type Source # initialObject :: Obj (Op k) (InitialObject (Op k)) Source # initialize :: Obj (Op k) a -> Op k (InitialObject (Op k)) a Source # | |
HasInitialObject (f (Fix f)) => HasInitialObject (Fix f) Source # | |
Defined in Data.Category.Fix type InitialObject (Fix f) :: Type Source # initialObject :: Obj (Fix f) (InitialObject (Fix f)) Source # initialize :: Obj (Fix f) a -> Fix f (InitialObject (Fix f)) a Source # | |
HasInitialObject ((->) :: Type -> Type -> Type) Source # | Any empty data type is an initial object in |
Defined in Data.Category.Limit type InitialObject (->) :: Type Source # initialObject :: Obj (->) (InitialObject (->)) Source # initialize :: Obj (->) a -> InitialObject (->) -> a Source # | |
(HasInitialObject c1, HasInitialObject c2) => HasInitialObject (c1 :**: c2) Source # | The initial object of the product of 2 categories is the product of their initial objects. |
Defined in Data.Category.Limit type InitialObject (c1 :**: c2) :: Type Source # initialObject :: Obj (c1 :**: c2) (InitialObject (c1 :**: c2)) Source # initialize :: Obj (c1 :**: c2) a -> (c1 :**: c2) (InitialObject (c1 :**: c2)) a Source # | |
(Category c, HasInitialObject d) => HasInitialObject (Nat c d) Source # | The constant functor to the initial object is itself the initial object in its functor category. |
Defined in Data.Category.Limit type InitialObject (Nat c d) :: Type Source # initialObject :: Obj (Nat c d) (InitialObject (Nat c d)) Source # initialize :: Obj (Nat c d) a -> Nat c d (InitialObject (Nat c d)) a Source # | |
(HasInitialObject c1, Category c2) => HasInitialObject (c1 :>>: c2) Source # | The initial object of the direct coproduct of categories is the initial object of the initial category. |
Defined in Data.Category.Limit type InitialObject (c1 :>>: c2) :: Type Source # initialObject :: Obj (c1 :>>: c2) (InitialObject (c1 :>>: c2)) Source # initialize :: Obj (c1 :>>: c2) a -> (c1 :>>: c2) (InitialObject (c1 :>>: c2)) a Source # | |
HasInitialObject (Dialg (Tuple1 ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) ()) (DiagProd ((->) :: Type -> Type -> Type))) Source # | The category for defining the natural numbers and primitive recursion can be described as
|
Defined in Data.Category.Dialg initialObject :: Obj (Dialg (Tuple1 (->) (->) ()) (DiagProd (->))) (InitialObject (Dialg (Tuple1 (->) (->) ()) (DiagProd (->)))) Source # initialize :: Obj (Dialg (Tuple1 (->) (->) ()) (DiagProd (->))) a -> Dialg (Tuple1 (->) (->) ()) (DiagProd (->)) (InitialObject (Dialg (Tuple1 (->) (->) ()) (DiagProd (->)))) a Source # |
Limits of type Pair
class Category k => HasBinaryProducts k where Source #
type BinaryProduct (k :: * -> * -> *) x y :: * Source #
proj1 :: Obj k x -> Obj k y -> k (BinaryProduct k x y) x Source #
proj2 :: Obj k x -> Obj k y -> k (BinaryProduct k x y) y Source #
(&&&) :: k a x -> k a y -> k a (BinaryProduct k x y) infixl 3 Source #
(***) :: k a1 b1 -> k a2 b2 -> k (BinaryProduct k a1 a2) (BinaryProduct k b1 b2) infixl 3 Source #
Instances
HasBinaryProducts Cat Source # | The product of categories |
Defined in Data.Category.Limit type BinaryProduct Cat x y :: Type Source # proj1 :: Obj Cat x -> Obj Cat y -> Cat (BinaryProduct Cat x y) x Source # proj2 :: Obj Cat x -> Obj Cat y -> Cat (BinaryProduct Cat x y) y Source # (&&&) :: Cat a x -> Cat a y -> Cat a (BinaryProduct Cat x y) Source # (***) :: Cat a1 b1 -> Cat a2 b2 -> Cat (BinaryProduct Cat a1 a2) (BinaryProduct Cat b1 b2) Source # | |
HasBinaryProducts Unit Source # | In the category of one object that object is its own product. |
Defined in Data.Category.Limit type BinaryProduct Unit x y :: Type Source # proj1 :: Obj Unit x -> Obj Unit y -> Unit (BinaryProduct Unit x y) x Source # proj2 :: Obj Unit x -> Obj Unit y -> Unit (BinaryProduct Unit x y) y Source # (&&&) :: Unit a x -> Unit a y -> Unit a (BinaryProduct Unit x y) Source # (***) :: Unit a1 b1 -> Unit a2 b2 -> Unit (BinaryProduct Unit a1 a2) (BinaryProduct Unit b1 b2) Source # | |
HasBinaryProducts Boolean Source # | Conjunction is the binary product in the Boolean category. |
Defined in Data.Category.Boolean type BinaryProduct Boolean x y :: Type Source # proj1 :: Obj Boolean x -> Obj Boolean y -> Boolean (BinaryProduct Boolean x y) x Source # proj2 :: Obj Boolean x -> Obj Boolean y -> Boolean (BinaryProduct Boolean x y) y Source # (&&&) :: Boolean a x -> Boolean a y -> Boolean a (BinaryProduct Boolean x y) Source # (***) :: Boolean a1 b1 -> Boolean a2 b2 -> Boolean (BinaryProduct Boolean a1 a2) (BinaryProduct Boolean b1 b2) Source # | |
HasBinaryCoproducts k => HasBinaryProducts (Op k) Source # | Binary products are the dual of binary coproducts. |
Defined in Data.Category.Limit type BinaryProduct (Op k) x y :: Type Source # proj1 :: Obj (Op k) x -> Obj (Op k) y -> Op k (BinaryProduct (Op k) x y) x Source # proj2 :: Obj (Op k) x -> Obj (Op k) y -> Op k (BinaryProduct (Op k) x y) y Source # (&&&) :: Op k a x -> Op k a y -> Op k a (BinaryProduct (Op k) x y) Source # (***) :: Op k a1 b1 -> Op k a2 b2 -> Op k (BinaryProduct (Op k) a1 a2) (BinaryProduct (Op k) b1 b2) Source # | |
HasBinaryProducts (f (Fix f)) => HasBinaryProducts (Fix f) Source # | |
Defined in Data.Category.Fix type BinaryProduct (Fix f) x y :: Type Source # proj1 :: Obj (Fix f) x -> Obj (Fix f) y -> Fix f (BinaryProduct (Fix f) x y) x Source # proj2 :: Obj (Fix f) x -> Obj (Fix f) y -> Fix f (BinaryProduct (Fix f) x y) y Source # (&&&) :: Fix f a x -> Fix f a y -> Fix f a (BinaryProduct (Fix f) x y) Source # (***) :: Fix f a1 b1 -> Fix f a2 b2 -> Fix f (BinaryProduct (Fix f) a1 a2) (BinaryProduct (Fix f) b1 b2) Source # | |
HasBinaryProducts ((->) :: Type -> Type -> Type) Source # | The tuple is the binary product in |
Defined in Data.Category.Limit type BinaryProduct (->) x y :: Type Source # proj1 :: Obj (->) x -> Obj (->) y -> BinaryProduct (->) x y -> x Source # proj2 :: Obj (->) x -> Obj (->) y -> BinaryProduct (->) x y -> y Source # (&&&) :: (a -> x) -> (a -> y) -> a -> BinaryProduct (->) x y Source # (***) :: (a1 -> b1) -> (a2 -> b2) -> BinaryProduct (->) a1 a2 -> BinaryProduct (->) b1 b2 Source # | |
(HasBinaryProducts c1, HasBinaryProducts c2) => HasBinaryProducts (c1 :**: c2) Source # | The binary product of the product of 2 categories is the product of their binary products. |
Defined in Data.Category.Limit type BinaryProduct (c1 :**: c2) x y :: Type Source # proj1 :: Obj (c1 :**: c2) x -> Obj (c1 :**: c2) y -> (c1 :**: c2) (BinaryProduct (c1 :**: c2) x y) x Source # proj2 :: Obj (c1 :**: c2) x -> Obj (c1 :**: c2) y -> (c1 :**: c2) (BinaryProduct (c1 :**: c2) x y) y Source # (&&&) :: (c1 :**: c2) a x -> (c1 :**: c2) a y -> (c1 :**: c2) a (BinaryProduct (c1 :**: c2) x y) Source # (***) :: (c1 :**: c2) a1 b1 -> (c1 :**: c2) a2 b2 -> (c1 :**: c2) (BinaryProduct (c1 :**: c2) a1 a2) (BinaryProduct (c1 :**: c2) b1 b2) Source # | |
(Category c, HasBinaryProducts d) => HasBinaryProducts (Nat c d) Source # | The functor product |
Defined in Data.Category.Limit type BinaryProduct (Nat c d) x y :: Type Source # proj1 :: Obj (Nat c d) x -> Obj (Nat c d) y -> Nat c d (BinaryProduct (Nat c d) x y) x Source # proj2 :: Obj (Nat c d) x -> Obj (Nat c d) y -> Nat c d (BinaryProduct (Nat c d) x y) y Source # (&&&) :: Nat c d a x -> Nat c d a y -> Nat c d a (BinaryProduct (Nat c d) x y) Source # (***) :: Nat c d a1 b1 -> Nat c d a2 b2 -> Nat c d (BinaryProduct (Nat c d) a1 a2) (BinaryProduct (Nat c d) b1 b2) Source # | |
(HasBinaryProducts c1, HasBinaryProducts c2) => HasBinaryProducts (c1 :>>: c2) Source # | |
Defined in Data.Category.Limit type BinaryProduct (c1 :>>: c2) x y :: Type Source # proj1 :: Obj (c1 :>>: c2) x -> Obj (c1 :>>: c2) y -> (c1 :>>: c2) (BinaryProduct (c1 :>>: c2) x y) x Source # proj2 :: Obj (c1 :>>: c2) x -> Obj (c1 :>>: c2) y -> (c1 :>>: c2) (BinaryProduct (c1 :>>: c2) x y) y Source # (&&&) :: (c1 :>>: c2) a x -> (c1 :>>: c2) a y -> (c1 :>>: c2) a (BinaryProduct (c1 :>>: c2) x y) Source # (***) :: (c1 :>>: c2) a1 b1 -> (c1 :>>: c2) a2 b2 -> (c1 :>>: c2) (BinaryProduct (c1 :>>: c2) a1 a2) (BinaryProduct (c1 :>>: c2) b1 b2) Source # |
data ProductFunctor (k :: * -> * -> *) Source #
Instances
(:*:) :: (Functor p, Functor q, Dom p ~ Dom q, Cod p ~ k, Cod q ~ k, HasBinaryProducts k) => p -> q -> p :*: q |
Instances
(Category (Dom p), Category (Cod p)) => Functor (p :*: q) Source # | The product of two functors, passing the same object to both functors and taking the product of the results. |
type Dom (p :*: q) Source # | |
Defined in Data.Category.Limit | |
type Cod (p :*: q) Source # | |
Defined in Data.Category.Limit | |
type (p :*: q) :% a Source # | |
Defined in Data.Category.Limit |
prodAdj :: HasBinaryProducts k => Adjunction (k :**: k) k (DiagProd k) (ProductFunctor k) Source #
A specialisation of the limit adjunction to products.
class Category k => HasBinaryCoproducts k where Source #
type BinaryCoproduct (k :: * -> * -> *) x y :: * Source #
inj1 :: Obj k x -> Obj k y -> k x (BinaryCoproduct k x y) Source #
inj2 :: Obj k x -> Obj k y -> k y (BinaryCoproduct k x y) Source #
(|||) :: k x a -> k y a -> k (BinaryCoproduct k x y) a infixl 2 Source #
(+++) :: k a1 b1 -> k a2 b2 -> k (BinaryCoproduct k a1 a2) (BinaryCoproduct k b1 b2) infixl 2 Source #
Instances
HasBinaryCoproducts Cat Source # | The coproduct of categories |
Defined in Data.Category.Limit type BinaryCoproduct Cat x y :: Type Source # inj1 :: Obj Cat x -> Obj Cat y -> Cat x (BinaryCoproduct Cat x y) Source # inj2 :: Obj Cat x -> Obj Cat y -> Cat y (BinaryCoproduct Cat x y) Source # (|||) :: Cat x a -> Cat y a -> Cat (BinaryCoproduct Cat x y) a Source # (+++) :: Cat a1 b1 -> Cat a2 b2 -> Cat (BinaryCoproduct Cat a1 a2) (BinaryCoproduct Cat b1 b2) Source # | |
HasBinaryCoproducts Unit Source # | In the category of one object that object is its own coproduct. |
Defined in Data.Category.Limit type BinaryCoproduct Unit x y :: Type Source # inj1 :: Obj Unit x -> Obj Unit y -> Unit x (BinaryCoproduct Unit x y) Source # inj2 :: Obj Unit x -> Obj Unit y -> Unit y (BinaryCoproduct Unit x y) Source # (|||) :: Unit x a -> Unit y a -> Unit (BinaryCoproduct Unit x y) a Source # (+++) :: Unit a1 b1 -> Unit a2 b2 -> Unit (BinaryCoproduct Unit a1 a2) (BinaryCoproduct Unit b1 b2) Source # | |
HasBinaryCoproducts Boolean Source # | Disjunction is the binary coproduct in the Boolean category. |
Defined in Data.Category.Boolean type BinaryCoproduct Boolean x y :: Type Source # inj1 :: Obj Boolean x -> Obj Boolean y -> Boolean x (BinaryCoproduct Boolean x y) Source # inj2 :: Obj Boolean x -> Obj Boolean y -> Boolean y (BinaryCoproduct Boolean x y) Source # (|||) :: Boolean x a -> Boolean y a -> Boolean (BinaryCoproduct Boolean x y) a Source # (+++) :: Boolean a1 b1 -> Boolean a2 b2 -> Boolean (BinaryCoproduct Boolean a1 a2) (BinaryCoproduct Boolean b1 b2) Source # | |
HasBinaryProducts k => HasBinaryCoproducts (Op k) Source # | Binary products are the dual of binary coproducts. |
Defined in Data.Category.Limit type BinaryCoproduct (Op k) x y :: Type Source # inj1 :: Obj (Op k) x -> Obj (Op k) y -> Op k x (BinaryCoproduct (Op k) x y) Source # inj2 :: Obj (Op k) x -> Obj (Op k) y -> Op k y (BinaryCoproduct (Op k) x y) Source # (|||) :: Op k x a -> Op k y a -> Op k (BinaryCoproduct (Op k) x y) a Source # (+++) :: Op k a1 b1 -> Op k a2 b2 -> Op k (BinaryCoproduct (Op k) a1 a2) (BinaryCoproduct (Op k) b1 b2) Source # | |
HasBinaryCoproducts (f (Fix f)) => HasBinaryCoproducts (Fix f) Source # | |
Defined in Data.Category.Fix type BinaryCoproduct (Fix f) x y :: Type Source # inj1 :: Obj (Fix f) x -> Obj (Fix f) y -> Fix f x (BinaryCoproduct (Fix f) x y) Source # inj2 :: Obj (Fix f) x -> Obj (Fix f) y -> Fix f y (BinaryCoproduct (Fix f) x y) Source # (|||) :: Fix f x a -> Fix f y a -> Fix f (BinaryCoproduct (Fix f) x y) a Source # (+++) :: Fix f a1 b1 -> Fix f a2 b2 -> Fix f (BinaryCoproduct (Fix f) a1 a2) (BinaryCoproduct (Fix f) b1 b2) Source # | |
(HasBinaryCoproducts c1, HasBinaryCoproducts c2) => HasBinaryCoproducts (c1 :**: c2) Source # | The binary coproduct of the product of 2 categories is the product of their binary coproducts. |
Defined in Data.Category.Limit type BinaryCoproduct (c1 :**: c2) x y :: Type Source # inj1 :: Obj (c1 :**: c2) x -> Obj (c1 :**: c2) y -> (c1 :**: c2) x (BinaryCoproduct (c1 :**: c2) x y) Source # inj2 :: Obj (c1 :**: c2) x -> Obj (c1 :**: c2) y -> (c1 :**: c2) y (BinaryCoproduct (c1 :**: c2) x y) Source # (|||) :: (c1 :**: c2) x a -> (c1 :**: c2) y a -> (c1 :**: c2) (BinaryCoproduct (c1 :**: c2) x y) a Source # (+++) :: (c1 :**: c2) a1 b1 -> (c1 :**: c2) a2 b2 -> (c1 :**: c2) (BinaryCoproduct (c1 :**: c2) a1 a2) (BinaryCoproduct (c1 :**: c2) b1 b2) Source # | |
(Category c, HasBinaryCoproducts d) => HasBinaryCoproducts (Nat c d) Source # | The functor coproduct |
Defined in Data.Category.Limit type BinaryCoproduct (Nat c d) x y :: Type Source # inj1 :: Obj (Nat c d) x -> Obj (Nat c d) y -> Nat c d x (BinaryCoproduct (Nat c d) x y) Source # inj2 :: Obj (Nat c d) x -> Obj (Nat c d) y -> Nat c d y (BinaryCoproduct (Nat c d) x y) Source # (|||) :: Nat c d x a -> Nat c d y a -> Nat c d (BinaryCoproduct (Nat c d) x y) a Source # (+++) :: Nat c d a1 b1 -> Nat c d a2 b2 -> Nat c d (BinaryCoproduct (Nat c d) a1 a2) (BinaryCoproduct (Nat c d) b1 b2) Source # | |
(HasBinaryCoproducts c1, HasBinaryCoproducts c2) => HasBinaryCoproducts (c1 :>>: c2) Source # | |
Defined in Data.Category.Limit type BinaryCoproduct (c1 :>>: c2) x y :: Type Source # inj1 :: Obj (c1 :>>: c2) x -> Obj (c1 :>>: c2) y -> (c1 :>>: c2) x (BinaryCoproduct (c1 :>>: c2) x y) Source # inj2 :: Obj (c1 :>>: c2) x -> Obj (c1 :>>: c2) y -> (c1 :>>: c2) y (BinaryCoproduct (c1 :>>: c2) x y) Source # (|||) :: (c1 :>>: c2) x a -> (c1 :>>: c2) y a -> (c1 :>>: c2) (BinaryCoproduct (c1 :>>: c2) x y) a Source # (+++) :: (c1 :>>: c2) a1 b1 -> (c1 :>>: c2) a2 b2 -> (c1 :>>: c2) (BinaryCoproduct (c1 :>>: c2) a1 a2) (BinaryCoproduct (c1 :>>: c2) b1 b2) Source # |
data CoproductFunctor (k :: * -> * -> *) Source #
Instances
(:+:) :: (Functor p, Functor q, Dom p ~ Dom q, Cod p ~ k, Cod q ~ k, HasBinaryCoproducts k) => p -> q -> p :+: q |
Instances
(Category (Dom p), Category (Cod p)) => Functor (p :+: q) Source # | The coproduct of two functors, passing the same object to both functors and taking the coproduct of the results. |
type Dom (p :+: q) Source # | |
Defined in Data.Category.Limit | |
type Cod (p :+: q) Source # | |
Defined in Data.Category.Limit | |
type (p :+: q) :% a Source # | |
Defined in Data.Category.Limit |
coprodAdj :: HasBinaryCoproducts k => Adjunction k (k :**: k) (CoproductFunctor k) (DiagProd k) Source #
A specialisation of the colimit adjunction to coproducts.