Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions groups.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ source-repository head
library
exposed-modules: Data.Group
-- other-modules:
build-depends: base >= 4.6 && < 5
, commutative-semigroups >= 0.0 && < 0.1
hs-source-dirs: src
default-language: Haskell2010

build-depends: base >= 4.6 && < 5
, commutative-semigroups >= 0.0 && < 0.1

if impl(ghc < 8.6) -- really, if base < 8.12
build-depends: base-orphans >= 0.8 && < 0.9
2 changes: 1 addition & 1 deletion src/Data/Group.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ instance Cyclic a => Cyclic (Identity a) where
-- (:*:) and (:.:) exist since base-4.6.0.0 but the Monoid instances
-- arrive in base-4.12.0.0.
-- Also, contravariant was moved into base in this version.
#if MIN_VERSION_base(4,12,0)
-- | Product of groups, Functor style.
instance (Group (f a), Group (g a)) => Group ((f :*: g) a) where
invert (a :*: b) = invert a :*: invert b
Expand All @@ -184,6 +183,7 @@ instance Group (f (g a)) => Group ((f :.: g) a) where
invert (Comp1 xs) = Comp1 (invert xs)
Comp1 xs ~~ Comp1 ys = Comp1 (xs ~~ ys)

#if MIN_VERSION_base(4,12,0)
instance Group a => Group (Op a b) where
invert (Op f) = Op (invert f)
pow (Op f) n = Op (\e -> pow (f e) n)
Expand Down