monoid-extras 0.4.4 → 0.5
raw patch · 4 files changed
+38/−17 lines, 4 filesdep ~basedep ~semigroupoidsdep ~semigroups
Dependency ranges changed: base, semigroupoids, semigroups
Files
- CHANGES +17/−0
- monoid-extras.cabal +3/−2
- src/Data/Monoid/Recommend.hs +2/−0
- src/Data/Monoid/WithSemigroup.hs +16/−15
CHANGES view
@@ -1,3 +1,20 @@+* 0.5: 14 May 2018++- Modernize Data.Monoid.WithSemigroup++ It used to export a type class Monoid' with no methods and a single+ instance, for use as a "poor man's constraint synonym" for the+ combination of Monoid and Semigroup. Now Monoid':++ - Is a real constraint synonym, using ConstraintKinds.+ - Is simply a synonym for Monoid under base-4.11 and later, in+ which case Semigroup is already a superclass of Monoid.++ This technically necessitates a major version bump but should not+ cause any issues for packages that depend on monoid-extras, other+ than potentially requiring the addition of a ConstraintKinds pragma+ under GHC 7.8.+ * 0.4.4: 8 April 2018 - Fix build on older (< 7.10) GHCs (thanks to George Wilson for the fix)
monoid-extras.cabal view
@@ -1,5 +1,5 @@ name: monoid-extras-version: 0.4.4+version: 0.5 synopsis: Various extra monoid-related definitions and utilities description: Various extra monoid-related definitions and utilities, such as monoid actions, monoid coproducts, semi-direct@@ -14,7 +14,7 @@ category: Data build-type: Simple cabal-version: >=1.10-tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2, GHC == 8.0.1, GHC == 8.2.2, GHC == 8.4.1+tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.2 source-repository head type: git@@ -53,5 +53,6 @@ main-is: SemiDirectProduct.hs type: exitcode-stdio-1.0 build-depends: base >= 4.3 && < 4.12+ , semigroups , criterion , monoid-extras
src/Data/Monoid/Recommend.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-}++{-# OPTIONS_GHC -fno-warn-unused-imports #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Monoid.Recommend
src/Data/Monoid/WithSemigroup.hs view
@@ -1,7 +1,9 @@-{-# LANGUAGE FlexibleInstances- , UndecidableInstances- #-}+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE CPP #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE UndecidableInstances #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Monoid.WithSemigroup@@ -17,16 +19,15 @@ ( Monoid' ) where -import Data.Semigroup---- Poor man's constraint synonym. Eventually, once it becomes--- standard, we can make this a real constraint synonym and get rid of--- the UndecidableInstances flag. Better yet, hopefully the Monoid--- class will eventually have a Semigroup superclass.+import Data.Semigroup --- | The @Monoid'@ class is a synonym for things which are instances--- of both 'Semigroup' and 'Monoid'. Ideally, the 'Monoid' class--- itself will eventually include a 'Semigroup' superclass and we--- can get rid of this.-class (Semigroup m, Monoid m) => Monoid' m-instance (Semigroup m, Monoid m) => Monoid' m+-- | For base < 4.11, the @Monoid'@ constraint is a synonym for things+-- which are instances of both 'Semigroup' and 'Monoid'. For base+-- version 4.11 and onwards, @Monoid@ has @Semigroup@ as a+-- superclass already, so for backwards compatibility @Monoid'@ is+-- provided as a synonym for @Monoid@.+#if MIN_VERSION_base(4,11,0)+type Monoid' = Monoid+#else+type Monoid' m = (Semigroup m, Monoid m)+#endif