groups 0.1.0.1 → 0.2.0.0
raw patch · 2 files changed
+7/−3 lines, 2 files
Files
- groups.cabal +1/−1
- src/Data/Group.hs +6/−2
groups.cabal view
@@ -1,5 +1,5 @@ name: groups-version: 0.1.0.1+version: 0.2.0.0 synopsis: Haskell 98 groups description: Haskell 98 groups. A group is a monoid with invertibility.
src/Data/Group.hs view
@@ -4,7 +4,8 @@ -- |A 'Group' is a 'Monoid' plus a function, 'invert', such that: ----- @a <> invert a == mempty@+-- @a \<> invert a == mempty@+-- @invert a \<> a == mempty@ class Monoid m => Group m where invert :: m -> m @@ -22,7 +23,10 @@ instance Group a => Group (Dual a) where invert = Dual . invert . getDual {-# INLINE invert #-}- ++instance Group b => Group (a -> b) where+ invert f = invert . f+ instance (Group a, Group b) => Group (a, b) where invert (a, b) = (invert a, invert b)