category 0.2.0.0 → 0.2.0.1
raw patch · 4 files changed
+15/−5 lines, 4 files
Files
- Control/Category/Const2.hs +2/−2
- Data/Morphism/Endo.hs +1/−0
- Data/Morphism/Iso.hs +5/−2
- category.cabal +7/−1
Control/Category/Const2.hs view
@@ -6,9 +6,9 @@ newtype Const2 a b c = Const2 a deriving (Semigroup, Monoid, Group) -instance Monoid a => Category (Const2 a) where+instance (Semigroup a, Monoid a) => Category (Const2 a) where id = Const2 mempty Const2 a . Const2 b = Const2 (a <> b) -instance Group a => Groupoid (Const2 a) where+instance (Semigroup a, Group a) => Groupoid (Const2 a) where invert (Const2 a) = Const2 (A.invert a)
Data/Morphism/Endo.hs view
@@ -9,6 +9,7 @@ Endo f <> Endo g = Endo (f . g) instance Category s => Monoid (Endo s a) where+ mappend = (<>) mempty = Endo id instance Groupoid s => Group (Endo s a) where
Data/Morphism/Iso.hs view
@@ -10,10 +10,13 @@ instance (Semigroup (s a b), Semigroup (s b a)) => Semigroup (Iso s a b) where Iso f f' <> Iso g g' = Iso (f <> g) (f' <> g') -instance (Monoid (s a b), Monoid (s b a)) => Monoid (Iso s a b) where+instance (Semigroup (s a b), Semigroup (s b a),+ Monoid (s a b), Monoid (s b a)) => Monoid (Iso s a b) where+ mappend = (<>) mempty = Iso mempty mempty -instance (Group (s a b), Group (s b a)) => Group (Iso s a b) where+instance (Semigroup (s a b), Semigroup (s b a),+ Group (s a b), Group (s b a)) => Group (Iso s a b) where invert (Iso f f') = Iso (A.invert f) (A.invert f') instance Category s => Category (Iso s) where
category.cabal view
@@ -1,5 +1,5 @@ name: category-version: 0.2.0.0+version: 0.2.0.1 synopsis: Categorical types and classes -- description: license: BSD3@@ -10,6 +10,8 @@ category: Control, Math build-type: Simple cabal-version: >=1.10+bug-reports: http://github.com/strake/category.hs/issues+tested-with: GHC ==8.2.2 library exposed-modules: Control.Categorical.Functor@@ -31,3 +33,7 @@ , FlexibleInstances , GeneralizedNewtypeDeriving ghc-options: -Wall++source-repository head+ type: git+ location: http://github.com/strake/category.hs.git