categories 0.57.0 → 0.58.0
raw patch · 2 files changed
+25/−15 lines, 2 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
- Control.Category.Monoidal: class Bifunctor p k k k => HasIdentity k p where { type family Id k p :: *; }
- Control.Category.Monoidal: instance HasIdentity (->) (,)
+ Control.Category.Monoidal: instance Comonoidal (->) (,)
+ Control.Category.Monoidal: instance Comonoidal (->) Either
+ Control.Category.Monoidal: instance Monoidal (->) Either
- Control.Category.Monoidal: class (Disassociative k p, HasIdentity k p) => Comonoidal k p
+ Control.Category.Monoidal: class Disassociative k p => Comonoidal k p
- Control.Category.Monoidal: class (Associative k p, HasIdentity k p) => Monoidal k p
+ Control.Category.Monoidal: class Associative k p => Monoidal k p
Files
- Control/Category/Monoidal.hs +24/−14
- categories.cabal +1/−1
Control/Category/Monoidal.hs view
@@ -21,18 +21,17 @@ ------------------------------------------------------------------------------------------- module Control.Category.Monoidal - ( HasIdentity(..)+ ( Id , Monoidal(..) , Comonoidal(..) ) where import Control.Category.Associative-import Control.Categorical.Bifunctor+import Data.Void -- | Denotes that we have some reasonable notion of 'Identity' for a particular 'Bifunctor' in this 'Category'. This -- notion is currently used by both 'Monoidal' and 'Comonoidal'-class Bifunctor p k k k => HasIdentity k p where- type Id k p :: *+type family Id k p :: * {- | A monoidal category. 'idl' and 'idr' are traditionally denoted lambda and rho the triangle identity holds:@@ -41,9 +40,9 @@ > second idl = first idr . associate -} -class (Associative k p, HasIdentity k p) => Monoidal k p where- idl :: k (p (Id k p) a) a- idr :: k (p a (Id k p)) a+class Associative k p => Monoidal k p where+ idl :: k (p (Id k p) a) a+ idr :: k (p a (Id k p)) a {- | A comonoidal category satisfies the dual form of the triangle identities @@ -59,9 +58,9 @@ > coidr . idr = id -}-class (Disassociative k p, HasIdentity k p) => Comonoidal k p where- coidl :: k a (p (Id k p) a)- coidr :: k a (p a (Id k p))+class Disassociative k p => Comonoidal k p where+ coidl :: k a (p (Id k p) a)+ coidr :: k a (p a (Id k p)) {-- RULES -- "bimap id idl/associate" second idl . associate = first idr@@ -78,10 +77,21 @@ "braid/coidl" braid . coidl = coidr --} -instance HasIdentity (->) (,) where- type Id (->) (,) = ()+type instance Id (->) (,) = ()+type instance Id (->) Either = Void instance Monoidal (->) (,) where- idl = snd- idr = fst+ idl = snd+ idr = fst +instance Monoidal (->) Either where+ idl = either absurd id+ idr = either id absurd++instance Comonoidal (->) (,) where+ coidl a = ((),a)+ coidr a = (a,())++instance Comonoidal (->) Either where+ coidl = Right+ coidr = Left
categories.cabal view
@@ -1,6 +1,6 @@ name: categories category: Control-version: 0.57.0+version: 0.58.0 license: BSD3 cabal-version: >= 1.2 license-file: LICENSE