data-category 0.3.0.1 → 0.3.0.2
raw patch · 5 files changed
+67/−19 lines, 5 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Category: instance (Category (~>)) => Category (Op (~>))
- Data.Category.CartesianClosed: instance (CartesianClosed (~>)) => Functor (ExpFunctor (~>))
- Data.Category.CartesianClosed: instance (CartesianClosed (~>)) => Functor (ExponentialWith (~>) y)
- Data.Category.CartesianClosed: instance (HasBinaryProducts (~>)) => Functor (ProductWith (~>) y)
- Data.Category.Dialg: instance (Functor f) => HasInitialObject (Dialg (EndoHask f) (Id (->)))
- Data.Category.Dialg: instance (Functor f) => HasTerminalObject (Dialg (Id (->)) (EndoHask f))
- Data.Category.Dialg: instance (HasTerminalObject (~>)) => Functor (NatF (~>))
- Data.Category.Discrete: instance (Category (Discrete n)) => Category (Discrete (S n))
- Data.Category.Discrete: instance (Category (~>)) => Functor (DiscreteDiagram (~>) Z ())
- Data.Category.Functor: instance (Category (~>)) => Functor ((~>) :-*: x)
- Data.Category.Functor: instance (Category (~>)) => Functor (Id (~>))
- Data.Category.Functor: instance (Category (~>)) => Functor (x :*-: (~>))
- Data.Category.Limit: instance (HasBinaryCoproducts (~>)) => Functor (CoproductFunctor (~>))
- Data.Category.Limit: instance (HasBinaryCoproducts (~>)) => HasColimits Pair (~>)
- Data.Category.Limit: instance (HasBinaryProducts (~>)) => Functor (ProductFunctor (~>))
- Data.Category.Limit: instance (HasBinaryProducts (~>)) => HasLimits Pair (~>)
- Data.Category.Limit: instance (HasInitialObject (~>)) => HasColimits Void (~>)
- Data.Category.Limit: instance (HasTerminalObject (~>)) => HasLimits Void (~>)
- Data.Category.Monoid: instance (Monoid m) => Category (MonoidA m)
- Data.Category.Monoidal: instance (Category (~>)) => HasUnit (FunctorCompose (~>))
- Data.Category.Monoidal: instance (Category (~>)) => TensorProduct (FunctorCompose (~>))
- Data.Category.NaturalTransformation: instance (Category (~>)) => Functor (FunctorCompose (~>))
- Data.Category.NaturalTransformation: instance (Category (~>)) => Functor (YonedaEmbedding (~>))
- Data.Category.NaturalTransformation: instance (Category (~>)) => Representable ((~>) :-*: x)
- Data.Category.NaturalTransformation: instance (Functor f) => Functor (Yoneda f)
- Data.Category.Peano: instance (HasTerminalObject (~>)) => Category (Peano (~>))
- Data.Category.Product: instance (Category (~>)) => Functor (DiagProd (~>))
+ Data.Category: instance Category (~>) => Category (Op (~>))
+ Data.Category.CartesianClosed: PShExponential :: PShExponential p q
+ Data.Category.CartesianClosed: data PShExponential ~> :: (* -> * -> *) p q
+ Data.Category.CartesianClosed: instance (Dom p ~ Op (~>), Dom q ~ Op (~>), Cod p ~ (->), Cod q ~ (->), Category (~>), Functor p, Functor q) => Functor (PShExponential (~>) p q)
+ Data.Category.CartesianClosed: instance CartesianClosed (~>) => Functor (ExpFunctor (~>))
+ Data.Category.CartesianClosed: instance CartesianClosed (~>) => Functor (ExponentialWith (~>) y)
+ Data.Category.CartesianClosed: instance Category (~>) => CartesianClosed (Presheaves (~>))
+ Data.Category.CartesianClosed: instance HasBinaryProducts (~>) => Functor (ProductWith (~>) y)
+ Data.Category.Dialg: instance Functor f => HasInitialObject (Dialg (EndoHask f) (Id (->)))
+ Data.Category.Dialg: instance Functor f => HasTerminalObject (Dialg (Id (->)) (EndoHask f))
+ Data.Category.Dialg: instance HasTerminalObject (~>) => Functor (NatF (~>))
+ Data.Category.Discrete: instance Category (Discrete n) => Category (Discrete (S n))
+ Data.Category.Discrete: instance Category (~>) => Functor (DiscreteDiagram (~>) Z ())
+ Data.Category.Functor: instance Category (~>) => Functor ((~>) :-*: x)
+ Data.Category.Functor: instance Category (~>) => Functor (Id (~>))
+ Data.Category.Functor: instance Category (~>) => Functor (x :*-: (~>))
+ Data.Category.Limit: (:*:) :: p -> q -> p :*: q
+ Data.Category.Limit: (:+:) :: p -> q -> p :+: q
+ Data.Category.Limit: instance (Category c, HasInitialObject d) => HasInitialObject (Nat c d)
+ Data.Category.Limit: instance (Category c, HasTerminalObject d) => HasTerminalObject (Nat c d)
+ Data.Category.Limit: instance HasBinaryCoproducts (~>) => Functor (CoproductFunctor (~>))
+ Data.Category.Limit: instance HasBinaryCoproducts (~>) => HasColimits Pair (~>)
+ Data.Category.Limit: instance HasBinaryProducts (~>) => Functor (ProductFunctor (~>))
+ Data.Category.Limit: instance HasBinaryProducts (~>) => HasLimits Pair (~>)
+ Data.Category.Limit: instance HasInitialObject (~>) => HasColimits Void (~>)
+ Data.Category.Limit: instance HasTerminalObject (~>) => HasLimits Void (~>)
+ Data.Category.Monoid: instance Monoid m => Category (MonoidA m)
+ Data.Category.Monoidal: instance Category (~>) => HasUnit (FunctorCompose (~>))
+ Data.Category.Monoidal: instance Category (~>) => TensorProduct (FunctorCompose (~>))
+ Data.Category.NaturalTransformation: class Functor f => Representable f where { type family RepresentingObject f :: *; }
+ Data.Category.NaturalTransformation: instance Category (~>) => Functor (FunctorCompose (~>))
+ Data.Category.NaturalTransformation: instance Category (~>) => Functor (YonedaEmbedding (~>))
+ Data.Category.NaturalTransformation: instance Category (~>) => Representable ((~>) :-*: x)
+ Data.Category.NaturalTransformation: instance Functor f => Functor (Yoneda f)
+ Data.Category.NaturalTransformation: represent :: (Representable f, (Dom f) ~ (Op c)) => f -> (c :-*: RepresentingObject f) :~> f
+ Data.Category.NaturalTransformation: type Presheaves ~> = Nat (Op ~>) (->)
+ Data.Category.NaturalTransformation: unrepresent :: (Representable f, (Dom f) ~ (Op c)) => f -> f :~> (c :-*: RepresentingObject f)
+ Data.Category.Peano: instance HasTerminalObject (~>) => Category (Peano (~>))
+ Data.Category.Product: instance Category (~>) => Functor (DiagProd (~>))
- Data.Category: (.) :: (Category ~>) => b ~> c -> a ~> b -> a ~> c
+ Data.Category: (.) :: Category ~> => b ~> c -> a ~> b -> a ~> c
- Data.Category: src :: (Category ~>) => a ~> b -> Obj ~> a
+ Data.Category: src :: Category ~> => a ~> b -> Obj ~> a
- Data.Category: tgt :: (Category ~>) => a ~> b -> Obj ~> b
+ Data.Category: tgt :: Category ~> => a ~> b -> Obj ~> b
- Data.Category.Adjunction: colimitAdj :: (HasColimits j ~>) => ColimitFunctor j ~> -> Adjunction ~> (Nat j ~>) (ColimitFunctor j ~>) (Diag j ~>)
+ Data.Category.Adjunction: colimitAdj :: HasColimits j ~> => ColimitFunctor j ~> -> Adjunction ~> (Nat j ~>) (ColimitFunctor j ~>) (Diag j ~>)
- Data.Category.Adjunction: limitAdj :: (HasLimits j ~>) => LimitFunctor j ~> -> Adjunction (Nat j ~>) ~> (Diag j ~>) (LimitFunctor j ~>)
+ Data.Category.Adjunction: limitAdj :: HasLimits j ~> => LimitFunctor j ~> -> Adjunction (Nat j ~>) ~> (Diag j ~>) (LimitFunctor j ~>)
- Data.Category.CartesianClosed: (^^^) :: (CartesianClosed ~>) => (z1 ~> z2) -> (y2 ~> y1) -> (Exponential ~> y1 z1 ~> Exponential ~> y2 z2)
+ Data.Category.CartesianClosed: (^^^) :: CartesianClosed ~> => (z1 ~> z2) -> (y2 ~> y1) -> (Exponential ~> y1 z1 ~> Exponential ~> y2 z2)
- Data.Category.CartesianClosed: apply :: (CartesianClosed ~>) => Obj ~> y -> Obj ~> z -> BinaryProduct ~> (Exponential ~> y z) y ~> z
+ Data.Category.CartesianClosed: apply :: CartesianClosed ~> => Obj ~> y -> Obj ~> z -> BinaryProduct ~> (Exponential ~> y z) y ~> z
- Data.Category.CartesianClosed: contextComonadDuplicate :: (CartesianClosed ~>) => Obj ~> s -> Obj ~> a -> Context ~> s a ~> Context ~> s (Context ~> s a)
+ Data.Category.CartesianClosed: contextComonadDuplicate :: CartesianClosed ~> => Obj ~> s -> Obj ~> a -> Context ~> s a ~> Context ~> s (Context ~> s a)
- Data.Category.CartesianClosed: contextComonadExtract :: (CartesianClosed ~>) => Obj ~> s -> Obj ~> a -> Context ~> s a ~> a
+ Data.Category.CartesianClosed: contextComonadExtract :: CartesianClosed ~> => Obj ~> s -> Obj ~> a -> Context ~> s a ~> a
- Data.Category.CartesianClosed: curry :: (CartesianClosed ~>) => Obj ~> x -> Obj ~> y -> Obj ~> z -> (ProductWith ~> y :% x) ~> z -> x ~> (ExponentialWith ~> y :% z)
+ Data.Category.CartesianClosed: curry :: CartesianClosed ~> => Obj ~> x -> Obj ~> y -> Obj ~> z -> (ProductWith ~> y :% x) ~> z -> x ~> (ExponentialWith ~> y :% z)
- Data.Category.CartesianClosed: curryAdj :: (CartesianClosed ~>) => Obj ~> y -> Adjunction ~> ~> (ProductWith ~> y) (ExponentialWith ~> y)
+ Data.Category.CartesianClosed: curryAdj :: CartesianClosed ~> => Obj ~> y -> Adjunction ~> ~> (ProductWith ~> y) (ExponentialWith ~> y)
- Data.Category.CartesianClosed: stateMonadJoin :: (CartesianClosed ~>) => Obj ~> s -> Obj ~> a -> State ~> s (State ~> s a) ~> State ~> s a
+ Data.Category.CartesianClosed: stateMonadJoin :: CartesianClosed ~> => Obj ~> s -> Obj ~> a -> State ~> s (State ~> s a) ~> State ~> s a
- Data.Category.CartesianClosed: stateMonadReturn :: (CartesianClosed ~>) => Obj ~> s -> Obj ~> a -> a ~> State ~> s a
+ Data.Category.CartesianClosed: stateMonadReturn :: CartesianClosed ~> => Obj ~> s -> Obj ~> a -> a ~> State ~> s a
- Data.Category.CartesianClosed: tuple :: (CartesianClosed ~>) => Obj ~> y -> Obj ~> z -> z ~> Exponential ~> y (BinaryProduct ~> z y)
+ Data.Category.CartesianClosed: tuple :: CartesianClosed ~> => Obj ~> y -> Obj ~> z -> z ~> Exponential ~> y (BinaryProduct ~> z y)
- Data.Category.CartesianClosed: uncurry :: (CartesianClosed ~>) => Obj ~> x -> Obj ~> y -> Obj ~> z -> x ~> (ExponentialWith ~> y :% z) -> (ProductWith ~> y :% x) ~> z
+ Data.Category.CartesianClosed: uncurry :: CartesianClosed ~> => Obj ~> x -> Obj ~> y -> Obj ~> z -> x ~> (ExponentialWith ~> y :% z) -> (ProductWith ~> y :% x) ~> z
- Data.Category.Dialg: anaHask :: (Functor f) => Ana (EndoHask f) a
+ Data.Category.Dialg: anaHask :: Functor f => Ana (EndoHask f) a
- Data.Category.Dialg: cataHask :: (Functor f) => Cata (EndoHask f) a
+ Data.Category.Dialg: cataHask :: Functor f => Cata (EndoHask f) a
- Data.Category.Discrete: arrowPair :: (Category ~>) => (x1 ~> x2) -> (y1 ~> y2) -> Nat Pair ~> (PairDiagram ~> x1 y1) (PairDiagram ~> x2 y2)
+ Data.Category.Discrete: arrowPair :: Category ~> => (x1 ~> x2) -> (y1 ~> y2) -> Nat Pair ~> (PairDiagram ~> x1 y1) (PairDiagram ~> x2 y2)
- Data.Category.Functor: (%) :: (Functor ftag) => ftag -> Dom ftag a b -> Cod ftag (ftag :% a) (ftag :% b)
+ Data.Category.Functor: (%) :: Functor ftag => ftag -> Dom ftag a b -> Cod ftag (ftag :% a) (ftag :% b)
- Data.Category.Limit: (&&&) :: (HasBinaryProducts ~>) => (a ~> x) -> (a ~> y) -> (a ~> BinaryProduct ~> x y)
+ Data.Category.Limit: (&&&) :: HasBinaryProducts ~> => (a ~> x) -> (a ~> y) -> (a ~> BinaryProduct ~> x y)
- Data.Category.Limit: (***) :: (HasBinaryProducts ~>) => (a1 ~> b1) -> (a2 ~> b2) -> (BinaryProduct ~> a1 a2 ~> BinaryProduct ~> b1 b2)
+ Data.Category.Limit: (***) :: HasBinaryProducts ~> => (a1 ~> b1) -> (a2 ~> b2) -> (BinaryProduct ~> a1 a2 ~> BinaryProduct ~> b1 b2)
- Data.Category.Limit: (+++) :: (HasBinaryCoproducts ~>) => (a1 ~> b1) -> (a2 ~> b2) -> (BinaryCoproduct ~> a1 a2 ~> BinaryCoproduct ~> b1 b2)
+ Data.Category.Limit: (+++) :: HasBinaryCoproducts ~> => (a1 ~> b1) -> (a2 ~> b2) -> (BinaryCoproduct ~> a1 a2 ~> BinaryCoproduct ~> b1 b2)
- Data.Category.Limit: (|||) :: (HasBinaryCoproducts ~>) => (x ~> a) -> (y ~> a) -> (BinaryCoproduct ~> x y ~> a)
+ Data.Category.Limit: (|||) :: HasBinaryCoproducts ~> => (x ~> a) -> (y ~> a) -> (BinaryCoproduct ~> x y ~> a)
- Data.Category.Limit: class (Category ~>) => HasBinaryCoproducts ~>
+ Data.Category.Limit: class Category ~> => HasBinaryCoproducts ~>
- Data.Category.Limit: class (Category ~>) => HasBinaryProducts ~>
+ Data.Category.Limit: class Category ~> => HasBinaryProducts ~>
- Data.Category.Limit: class (Category ~>) => HasInitialObject ~> where { type family InitialObject ~> :: *; }
+ Data.Category.Limit: class Category ~> => HasInitialObject ~> where { type family InitialObject ~> :: *; }
- Data.Category.Limit: class (Category ~>) => HasTerminalObject ~> where { type family TerminalObject ~> :: *; }
+ Data.Category.Limit: class Category ~> => HasTerminalObject ~> where { type family TerminalObject ~> :: *; }
- Data.Category.Limit: colimitFactorizer :: ((Cod f) ~ ~>) => ColimitUniversal f -> (forall n. Cocone f n -> Colimit f ~> n)
+ Data.Category.Limit: colimitFactorizer :: (Cod f) ~ ~> => ColimitUniversal f -> (forall n. Cocone f n -> Colimit f ~> n)
- Data.Category.Limit: colimitUniv :: (HasColimits j ~>) => Obj (Nat j ~>) f -> ColimitUniversal f
+ Data.Category.Limit: colimitUniv :: HasColimits j ~> => Obj (Nat j ~>) f -> ColimitUniversal f
- Data.Category.Limit: colimitUniversal :: ((Cod f) ~ ~>) => Cocone f (Colimit f) -> (forall n. Cocone f n -> Colimit f ~> n) -> ColimitUniversal f
+ Data.Category.Limit: colimitUniversal :: (Cod f) ~ ~> => Cocone f (Colimit f) -> (forall n. Cocone f n -> Colimit f ~> n) -> ColimitUniversal f
- Data.Category.Limit: endoHaskColimit :: (Functor f) => ColimitUniversal (EndoHask f)
+ Data.Category.Limit: endoHaskColimit :: Functor f => ColimitUniversal (EndoHask f)
- Data.Category.Limit: endoHaskLimit :: (Functor f) => LimitUniversal (EndoHask f)
+ Data.Category.Limit: endoHaskLimit :: Functor f => LimitUniversal (EndoHask f)
- Data.Category.Limit: initialObject :: (HasInitialObject ~>) => Obj ~> (InitialObject ~>)
+ Data.Category.Limit: initialObject :: HasInitialObject ~> => Obj ~> (InitialObject ~>)
- Data.Category.Limit: initialize :: (HasInitialObject ~>) => Obj ~> a -> InitialObject ~> ~> a
+ Data.Category.Limit: initialize :: HasInitialObject ~> => Obj ~> a -> InitialObject ~> ~> a
- Data.Category.Limit: inj1 :: (HasBinaryCoproducts ~>) => Obj ~> x -> Obj ~> y -> x ~> BinaryCoproduct ~> x y
+ Data.Category.Limit: inj1 :: HasBinaryCoproducts ~> => Obj ~> x -> Obj ~> y -> x ~> BinaryCoproduct ~> x y
- Data.Category.Limit: inj2 :: (HasBinaryCoproducts ~>) => Obj ~> x -> Obj ~> y -> y ~> BinaryCoproduct ~> x y
+ Data.Category.Limit: inj2 :: HasBinaryCoproducts ~> => Obj ~> x -> Obj ~> y -> y ~> BinaryCoproduct ~> x y
- Data.Category.Limit: limitFactorizer :: ((Cod f) ~ ~>) => LimitUniversal f -> (forall n. Cone f n -> n ~> Limit f)
+ Data.Category.Limit: limitFactorizer :: (Cod f) ~ ~> => LimitUniversal f -> (forall n. Cone f n -> n ~> Limit f)
- Data.Category.Limit: limitUniv :: (HasLimits j ~>) => Obj (Nat j ~>) f -> LimitUniversal f
+ Data.Category.Limit: limitUniv :: HasLimits j ~> => Obj (Nat j ~>) f -> LimitUniversal f
- Data.Category.Limit: limitUniversal :: ((Cod f) ~ ~>) => Cone f (Limit f) -> (forall n. Cone f n -> n ~> Limit f) -> LimitUniversal f
+ Data.Category.Limit: limitUniversal :: (Cod f) ~ ~> => Cone f (Limit f) -> (forall n. Cone f n -> n ~> Limit f) -> LimitUniversal f
- Data.Category.Limit: proj1 :: (HasBinaryProducts ~>) => Obj ~> x -> Obj ~> y -> BinaryProduct ~> x y ~> x
+ Data.Category.Limit: proj1 :: HasBinaryProducts ~> => Obj ~> x -> Obj ~> y -> BinaryProduct ~> x y ~> x
- Data.Category.Limit: proj2 :: (HasBinaryProducts ~>) => Obj ~> x -> Obj ~> y -> BinaryProduct ~> x y ~> y
+ Data.Category.Limit: proj2 :: HasBinaryProducts ~> => Obj ~> x -> Obj ~> y -> BinaryProduct ~> x y ~> y
- Data.Category.Limit: terminalObject :: (HasTerminalObject ~>) => Obj ~> (TerminalObject ~>)
+ Data.Category.Limit: terminalObject :: HasTerminalObject ~> => Obj ~> (TerminalObject ~>)
- Data.Category.Limit: terminate :: (HasTerminalObject ~>) => Obj ~> a -> a ~> TerminalObject ~>
+ Data.Category.Limit: terminate :: HasTerminalObject ~> => Obj ~> a -> a ~> TerminalObject ~>
- Data.Category.Monoid: foldMap :: (Monoid m) => (a -> m) -> [a] -> m
+ Data.Category.Monoid: foldMap :: Monoid m => (a -> m) -> [a] -> m
- Data.Category.Monoid: listComonadDuplicate :: (Monoid m) => [m] -> [[m]]
+ Data.Category.Monoid: listComonadDuplicate :: Monoid m => [m] -> [[m]]
- Data.Category.Monoid: listComonadExtract :: (Monoid m) => [m] -> m
+ Data.Category.Monoid: listComonadExtract :: Monoid m => [m] -> m
- Data.Category.Monoidal: ComonoidObject :: (forall ~>. ((Cod f) ~ ~>) => a ~> Unit f) -> (forall ~>. ((Cod f) ~ ~>) => a ~> (f :% (a, a))) -> ComonoidObject f a
+ Data.Category.Monoidal: ComonoidObject :: (forall ~>. (Cod f) ~ ~> => a ~> Unit f) -> (forall ~>. (Cod f) ~ ~> => a ~> (f :% (a, a))) -> ComonoidObject f a
- Data.Category.Monoidal: MonoidObject :: (forall ~>. ((Cod f) ~ ~>) => Unit f ~> a) -> (forall ~>. ((Cod f) ~ ~>) => (f :% (a, a)) ~> a) -> MonoidObject f a
+ Data.Category.Monoidal: MonoidObject :: (forall ~>. (Cod f) ~ ~> => Unit f ~> a) -> (forall ~>. (Cod f) ~ ~> => (f :% (a, a)) ~> a) -> MonoidObject f a
- Data.Category.Monoidal: class (Functor f) => HasUnit f where { type family Unit f :: *; }
+ Data.Category.Monoidal: class Functor f => HasUnit f where { type family Unit f :: *; }
- Data.Category.Monoidal: class (HasUnit f) => TensorProduct f
+ Data.Category.Monoidal: class HasUnit f => TensorProduct f
- Data.Category.Monoidal: comultiply :: ComonoidObject f a -> forall ~>. ((Cod f) ~ ~>) => a ~> (f :% (a, a))
+ Data.Category.Monoidal: comultiply :: ComonoidObject f a -> forall ~>. (Cod f) ~ ~> => a ~> (f :% (a, a))
- Data.Category.Monoidal: counit :: ComonoidObject f a -> forall ~>. ((Cod f) ~ ~>) => a ~> Unit f
+ Data.Category.Monoidal: counit :: ComonoidObject f a -> forall ~>. (Cod f) ~ ~> => a ~> Unit f
- Data.Category.Monoidal: multiply :: MonoidObject f a -> forall ~>. ((Cod f) ~ ~>) => (f :% (a, a)) ~> a
+ Data.Category.Monoidal: multiply :: MonoidObject f a -> forall ~>. (Cod f) ~ ~> => (f :% (a, a)) ~> a
- Data.Category.Monoidal: unit :: MonoidObject f a -> forall ~>. ((Cod f) ~ ~>) => Unit f ~> a
+ Data.Category.Monoidal: unit :: MonoidObject f a -> forall ~>. (Cod f) ~ ~> => Unit f ~> a
- Data.Category.Monoidal: unitObject :: (HasUnit f) => Obj (Cod f) (Unit f)
+ Data.Category.Monoidal: unitObject :: HasUnit f => Obj (Cod f) (Unit f)
- Data.Category.NaturalTransformation: natId :: (Functor f) => f -> Nat (Dom f) (Cod f) f f
+ Data.Category.NaturalTransformation: natId :: Functor f => f -> Nat (Dom f) (Cod f) f f
- Data.Category.Peano: peanoId :: (Category ~>) => PeanoO ~> a -> Obj (Peano ~>) a
+ Data.Category.Peano: peanoId :: Category ~> => PeanoO ~> a -> Obj (Peano ~>) a
- Data.Category.Peano: peanoO :: (Category ~>) => Obj (Peano ~>) a -> PeanoO ~> a
+ Data.Category.Peano: peanoO :: Category ~> => Obj (Peano ~>) a -> PeanoO ~> a
Files
- Data/Category/Adjunction.hs +7/−3
- Data/Category/CartesianClosed.hs +23/−4
- Data/Category/Limit.hs +23/−4
- Data/Category/NaturalTransformation.hs +13/−7
- data-category.cabal +1/−1
Data/Category/Adjunction.hs view
@@ -81,18 +81,22 @@ -initialPropAdjunction :: (Functor f, Functor g, Category c, Category d, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d)+initialPropAdjunction :: forall f g c d. (Functor f, Functor g, Category c, Category d, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d) => f -> g -> (forall y. Obj d y -> InitialUniversal y g (f :% y)) -> Adjunction c d f g initialPropAdjunction f g univ = mkAdjunction f g un coun where+ coun :: forall a. Obj c a -> c (f :% (g :% a)) a coun a = initialFactorizer (univ (g % a)) a (g % a)+ un :: forall a. Obj d a -> d a (g :% (f :% a)) un a = initialMorphism (univ a)- -terminalPropAdjunction :: (Functor f, Functor g, Category c, Category d, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d)+ +terminalPropAdjunction :: forall f g c d. (Functor f, Functor g, Category c, Category d, Dom f ~ d, Cod f ~ c, Dom g ~ c, Cod g ~ d) => f -> g -> (forall x. Obj c x -> TerminalUniversal x f (g :% x)) -> Adjunction c d f g terminalPropAdjunction f g univ = mkAdjunction f g un coun where+ un :: forall a. Obj d a -> d a (g :% (f :% a)) un a = terminalFactorizer (univ (f % a)) a (f % a)+ coun :: forall a. Obj c a -> c (f :% (g :% a)) a coun a = terminalMorphism (univ a)
Data/Category/CartesianClosed.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE TypeOperators, TypeFamilies, GADTs, Rank2Types, ScopedTypeVariables, UndecidableInstances #-}+{-# LANGUAGE TypeOperators, TypeFamilies, GADTs, Rank2Types, ScopedTypeVariables, UndecidableInstances, TypeSynonymInstances #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Category.CartesianClosed@@ -42,7 +42,7 @@ type instance Exponential (->) y z = y -> z -instance (CartesianClosed (->)) where+instance CartesianClosed (->) where apply _ _ (f, y) = f y tuple _ _ z = \y -> (z, y)@@ -70,18 +70,36 @@ type instance Exponential Cat (CatW c) (CatW d) = CatW (Nat c d) -instance (CartesianClosed Cat) where+instance CartesianClosed Cat where apply CatA{} CatA{} = CatA CatApply tuple CatA{} CatA{} = CatA CatTuple (CatA f) ^^^ (CatA h) = CatA (Wrap f h) +data PShExponential ((~>) :: * -> * -> *) p q = PShExponential+type instance Dom (PShExponential (~>) p q) = Op (~>)+type instance Cod (PShExponential (~>) p q) = (->)+type instance PShExponential (~>) p q :% a = Presheaves (~>) ((YonedaEmbedding (~>) :% a) :*: p) q+instance (Category (~>), Dom p ~ Op (~>), Dom q ~ Op (~>), Cod p ~ (->), Cod q ~ (->), Functor p, Functor q)+ => Functor (PShExponential (~>) p q) where+ PShExponential % Op f = h f where+ h :: a ~> b -> PShExponential (~>) p q :% b -> PShExponential (~>) p q :% a+ h g (Nat (_ :*: p) q n) = Nat (Hom_X (src g) :*: p) q $ \i (i2a, pi) -> n i (g . i2a, pi) +type instance Exponential (Presheaves (~>)) y z = PShExponential (~>) y z++instance Category (~>) => CartesianClosed (Presheaves (~>)) where+ + apply (Nat y _ _) (Nat z _ _) = Nat (PShExponential :*: y) z $ \(Op i) (n, yi) -> (n ! Op i) (i, yi)+ tuple (Nat y _ _) (Nat z _ _) = Nat z PShExponential $ \(Op i) zi -> (Nat (Hom_X i) z $ \_ j2i -> (z % Op j2i) zi) *** natId y+ zn@Nat{} ^^^ yn@Nat{} = Nat PShExponential PShExponential $ \(Op i) n -> zn . n . (natId (Hom_X i) *** yn)++ data ProductWith (~>) y = ProductWith (Obj (~>) y) type instance Dom (ProductWith (~>) y) = (~>) type instance Cod (ProductWith (~>) y) = (~>)-type instance ProductWith (~>) y :% z = ProductFunctor (~>) :% (z, y)+type instance ProductWith (~>) y :% z = BinaryProduct (~>) z y instance HasBinaryProducts (~>) => Functor (ProductWith (~>) y) where ProductWith y % f = f *** y @@ -117,3 +135,4 @@ contextComonadDuplicate :: CartesianClosed (~>) => Obj (~>) s -> Obj (~>) a -> Context (~>) s a ~> Context (~>) s (Context (~>) s a) contextComonadDuplicate s a = M.comultiply (adjunctionComonad $ curryAdj s) ! a+
Data/Category/Limit.hs view
@@ -22,7 +22,7 @@ ----------------------------------------------------------------------------- module Data.Category.Limit ( - -- * Prelimiairies+ -- * Preliminairies -- ** Diagonal Functor Diag(..)@@ -67,11 +67,11 @@ , BinaryProduct , HasBinaryProducts(..) , ProductFunctor(..)- , (:*:)+ , (:*:)(..) , BinaryCoproduct , HasBinaryCoproducts(..) , CoproductFunctor(..)- , (:+:)+ , (:+:)(..) -- ** Limits of type Hask , ForAll(..)@@ -267,7 +267,16 @@ terminate (CatA _) = CatA $ Const Z +-- | The constant functor to the terminal object is itself the terminal object in its functor category.+instance (Category c, HasTerminalObject d) => HasTerminalObject (Nat c d) where+ + type TerminalObject (Nat c d) = Const c d (TerminalObject d)+ + terminalObject = natId $ Const terminalObject+ + terminate (Nat f _ _) = Nat f (Const terminalObject) $ terminate . (f %) + -- | An initial object is the colimit of the functor from /0/ to (~>). class Category (~>) => HasInitialObject (~>) where @@ -287,9 +296,9 @@ (initialize . coconeVertex) --- | Any empty data type is an initial object in Hask. data Zero +-- | Any empty data type is an initial object in @Hask@. instance HasInitialObject (->) where type InitialObject (->) = Zero@@ -299,6 +308,7 @@ -- With thanks to Conor McBride initialize _ x = x `seq` error "we never get this far" +-- | The empty category is the initial object in @Cat@. instance HasInitialObject Cat where type InitialObject Cat = CatW Void@@ -306,6 +316,15 @@ initialObject = CatA Id initialize (CatA _) = CatA Nil++-- | The constant functor to the initial object is itself the initial object in its functor category.+instance (Category c, HasInitialObject d) => HasInitialObject (Nat c d) where+ + type InitialObject (Nat c d) = Const c d (InitialObject d)+ + initialObject = natId $ Const initialObject+ + initialize (Nat f _ _) = Nat (Const initialObject) f $ initialize . (f %)
Data/Category/NaturalTransformation.hs view
@@ -29,6 +29,10 @@ , Postcompose(..) , Wrap(..) + -- ** Presheaves+ , Presheaves+ , Representable(..)+ -- ** Yoneda , YonedaEmbedding(..) , Yoneda(..)@@ -114,7 +118,7 @@ type instance Precompose f d :% g = g :.: f instance (Functor f, Category d) => Functor (Precompose f d) where- Precompose f % (Nat g h n) = Nat (g :.: f) (h :.: f) $ n . (f %)+ Precompose f % n = n `o` natId f -- | @Postcompose f c@ is the functor such that @Postcompose f c :% g = f :.: g@, @@ -127,7 +131,7 @@ type instance Postcompose f c :% g = f :.: g instance (Functor f, Category c) => Functor (Postcompose f c) where- Postcompose f % (Nat g h n) = Nat (f :.: g) (f :.: h) $ (f %) . n+ Postcompose f % n = natId f `o` n -- | @Wrap f h@ is the functor such that @Wrap f h :% g = f :.: g :.: h@, @@ -139,9 +143,11 @@ type instance Wrap f h :% g = f :.: g :.: h instance (Functor f, Functor h) => Functor (Wrap f h) where- Wrap f h % (Nat g1 g2 n) = Nat (f :.: g1 :.: h) (f :.: g2 :.: h) $ (f %) . n . (h %)+ Wrap f h % n = natId f `o` n `o` natId h +type Presheaves (~>) = Nat (Op (~>)) (->)+ -- | A functor F: Op(C) -> Set is representable if it is naturally isomorphic to the contravariant hom-functor. class Functor f => Representable f where type RepresentingObject f :: *@@ -158,12 +164,12 @@ data YonedaEmbedding :: (* -> * -> *) -> * where YonedaEmbedding :: Category (~>) => YonedaEmbedding (~>) -type instance Dom (YonedaEmbedding (~>)) = Op (~>)-type instance Cod (YonedaEmbedding (~>)) = Nat (~>) (->)-type instance YonedaEmbedding (~>) :% a = a :*-: (~>)+type instance Dom (YonedaEmbedding (~>)) = (~>)+type instance Cod (YonedaEmbedding (~>)) = Nat (Op (~>)) (->)+type instance YonedaEmbedding (~>) :% a = (~>) :-*: a instance Category (~>) => Functor (YonedaEmbedding (~>)) where- YonedaEmbedding % (Op f) = Nat (HomX_ $ tgt f) (HomX_ $ src f) $ \_ -> (. f)+ YonedaEmbedding % f = Nat (Hom_X $ src f) (Hom_X $ tgt f) $ \_ -> (f .) data Yoneda f = Yoneda
data-category.cabal view
@@ -1,5 +1,5 @@ name: data-category-version: 0.3.0.1+version: 0.3.0.2 synopsis: Restricted categories description: Data-category is a collection of categories, and some categorical constructions on them.