monoid-subclasses 0.4.3.1 → 0.4.3.2
raw patch · 5 files changed
+116/−17 lines, 5 filesdep ~basedep ~tasty-quickcheckPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, tasty-quickcheck
API changes (from Hackage documentation)
Files
- CHANGELOG.md +98/−0
- Data/Monoid/Cancellative.hs +2/−1
- README.md +8/−8
- Test/TestMonoidSubclasses.hs +2/−2
- monoid-subclasses.cabal +6/−6
+ CHANGELOG.md view
@@ -0,0 +1,98 @@++Version 0.4.3.2+---------------+Fixed compilation errors with GHC 7.8.4 and older++Version 0.4.3.1+---------------+Bumped the vector dependency upper bounds++Version 0.4.3+---------------+* Added instances for 3- and 4-tuples+* Re-implemented Concat as an own data type, dropping Seq++Version 0.4.2.1+---------------+* Fixed compilation problems with GHC 8 and containers-0.5.7+* Fixed compilation problems with GHC 8 and containers-0.5.7+* Merge pull request #10 from mgiles: minor typo in FactorialMonoid laws++Version 0.4.2+---------------+* Fixed a bug in splitAt implementation for ByteStringUTF8+* Merge pull request #9 from phadej: use newest quickcheck-instances+* Removed the overzealous assertions from ByteStringUTF8++Version 0.4.1.2+---------------+Removing accidental reference to Instances.Markup module++Version 0.4.1.1+---------------+* Bumped the vector dependency upper bounds+* Removed GHC-prof-options from the cabal file++Version 0.4.1+---------------+* Changed the Prelude imports to enable compilation with GHC 7.4+* Added INLINE pragmas+* Added the toString method to TextualMonoid class+* Importing Text.Show.Functions to avoid overlapping instances+* Eliminated the redundant import warnings from GHC 7.10.1++Version 0.4.0.4+---------------+* Added -Wall GHC option and eliminated almost all the warnings+* Fixed a bug in the Textual instance of ByteStringUTF8++Version 0.4.0.3+---------------+* Excluding the imports of foldMap from Prelude++Version 0.4.0.2+---------------+* Added more tests and fixed a bug in Stateful+* Fixed a bug in Positioned.span_+* Optimized the Stateful data type++Version 0.3.6.2+---------------+* Added a bunch of pragmas++Version 0.3.6+---------------+* Deprecated all the inject functions+* Registered the new Stateful module++Version 0.3.4.1+---------------+Accomodating the text-1.0 release++* Introduced the function ByteStringUTF8.decode+* Removed the utf-string dependency+* Replaced the utf-string import by a more efficient UTF-8 encoding++Version 0.3.1+---------------+* Added the Data.Monoid.Instances.Concat module and tests+* Added the PositiveMonoid class+* Added the StableFactorialMonoid subclass of FactorialMonoid+* Added more instances for ()++Version 0.3+---------------+Added the CommutativeMonoid class at the root of the Cancellative classes++Version 0.2+---------------+* Added TextualMonoid instances for Seq Char and Vector Char+* Renamed the FactorialMonoid method map to foldMap in keeping with Foldable++Version 0.1.2+---------------+Optimizations of the default Factorial methods and of the ButeStringUTF8 instances++Version 0.1+---------------+Initial release
Data/Monoid/Cancellative.hs view
@@ -1,5 +1,5 @@ {- - Copyright 2013-2015 Mario Blazevic+ Copyright 2013-2017 Mario Blazevic License: BSD3 (see BSD3-LICENSE.txt file) -}@@ -46,6 +46,7 @@ import qualified Prelude +import Control.Applicative ((<$>), (<*>)) import Data.Monoid -- (Monoid, Dual(..), Sum(..), Product(..)) import qualified Data.List as List import Data.Maybe (isJust)
README.md view
@@ -3,22 +3,22 @@ ### Subclasses of Monoid with a solid theoretical foundation and practical purposes ### -The monoid-subclasses package has been released [on Hackage](http://hackage.haskell.org/package/monoid-subclasses). The package defines several classes that are richer than [monoids](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Monoid.html#t:Monoid) but less demanding than [groups](http://hackage.haskell.org/packages/archive/groups/0.1.0.1/doc/html/Data-Group.html):- * [ReductiveMonoid](http://hackage.haskell.org/packages/archive/monoid-subclasses/0.1/doc/html/Data-Monoid-Cancellative.html#t:ReductiveMonoid) provides the operator `</>` which acts as a partial inverse of the `<>` operator, _i.e._, `Monoid.mappend`.- * [CancellativeMonoid](http://hackage.haskell.org/packages/archive/monoid-subclasses/0.1/doc/html/Data-Monoid-Cancellative.html#t:CancellativeMonoid) is a subclass of `ReductiveMonoid` that provides additional guarantees about the `</>` operation result:+The monoid-subclasses package has been released [on Hackage](http://hackage.haskell.org/package/monoid-subclasses). The package defines several classes that are richer than [monoids](http://hackage.haskell.org/package/base/docs/Data-Monoid.html#t:Monoid) but less demanding than [groups](http://hackage.haskell.org/package/groups/docs/Data-Group.html):+ * [ReductiveMonoid](http://hackage.haskell.org/package/monoid-subclasses/docs/Data-Monoid-Cancellative.html#t:ReductiveMonoid) provides the operator `</>` which acts as a partial inverse of the `<>` operator, _i.e._, `Monoid.mappend`.+ * [CancellativeMonoid](http://hackage.haskell.org/package/monoid-subclasses/docs/Data-Monoid-Cancellative.html#t:CancellativeMonoid) is a subclass of `ReductiveMonoid` that provides additional guarantees about the `</>` operation result: (a <> b) </> a == Just b (a <> b) </> b == Just a Every group (<em>i.e.</em>, every `Monoid a` with the operation `inverse :: a -> a`) is a `CancellativeMonoid` where `a </> b = Just (a <> inverse b)` but not every `CancellativeMonoid` is a group.- * [GCDMonoid](http://hackage.haskell.org/packages/archive/monoid-subclasses/0.1/doc/html/Data-Monoid-Cancellative.html#t:GCDMonoid) is a subclass of `ReductiveMonoid` that provides the `gcd` operation for getting the greatest common denominator for two given monoid values.- * [MonoidNull](http://hackage.haskell.org/packages/archive/monoid-subclasses/0.1/doc/html/Data-Monoid-Null.html) class provides the Boolean `null` operation that checks if the argument monoid is `mempty`.- * [FactorialMonoid](http://hackage.haskell.org/packages/archive/monoid-subclasses/0.1/doc/html/Data-Monoid-Factorial.html) class represents monoids that can be split up into irreducible factors.+ * [GCDMonoid](http://hackage.haskell.org/package/monoid-subclasses/docs/Data-Monoid-Cancellative.html#t:GCDMonoid) is a subclass of `ReductiveMonoid` that provides the `gcd` operation for getting the greatest common denominator for two given monoid values.+ * [MonoidNull](http://hackage.haskell.org/package/monoid-subclasses/docs/Data-Monoid-Null.html) class provides the Boolean `null` operation that checks if the argument monoid is `mempty`.+ * [FactorialMonoid](http://hackage.haskell.org/package/monoid-subclasses/docs/Data-Monoid-Factorial.html) class represents monoids that can be split up into irreducible factors. -That's the theoretical point of view. From the practical point of view, the main purpose of the _monoid-subclasses_ package is similar to that of [ListLike](http://hackage.haskell.org/packages/archive/ListLike/latest/doc/html/Data-ListLike.html) - to provide unifying abstractions for various monoidal data types in Haskell, primarily [String](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-String.html#t:String), [ByteString](http://hackage.haskell.org/packages/archive/bytestring/latest/doc/html/Data-ByteString.html#t:ByteString), and [Text](http://hackage.haskell.org/package/text). All three types are already instances of the [Monoid](http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Monoid.html#t:Monoid) class. While that abstraction is useful for building sequences of data, it doesn't help with deconstructing them.+That's the theoretical point of view. From the practical point of view, the main purpose of the _monoid-subclasses_ package is similar to that of [ListLike](http://hackage.haskell.org/package/ListLike/docs/Data-ListLike.html) - to provide unifying abstractions for various monoidal data types in Haskell, primarily [String](http://hackage.haskell.org/package/base/docs/Data-String.html#t:String), [ByteString](http://hackage.haskell.org/package/bytestring/docs/Data-ByteString.html#t:ByteString), and [Text](http://hackage.haskell.org/package/text). All three types are already instances of the [Monoid](http://hackage.haskell.org/package/base/docs/Data-Monoid.html#t:Monoid) class. While that abstraction is useful for building sequences of data, it doesn't help with deconstructing them. That being said, there are two major differences in the goals of _ListLike_ and _monoid-subclasses_:- * _ListLike_ strives to reproduce the standard [Data.List](http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/Data-List.html) interface, whereas _monoid-subclasses_ builds from deeper theoretical foundations; and+ * _ListLike_ strives to reproduce the standard [Data.List](http://hackage.haskell.org/package/base/docs/Data-List.html) interface, whereas _monoid-subclasses_ builds from deeper theoretical foundations; and * The _monoid-subclasses_ implementation uses standard Haskell 2010, with the exception of two minor extensions which can be worked around if necessary. The [incremental-parser](http://hackage.haskell.org/package/incremental-parser) package provides one example of use of _monoid-subclasses_. Another example is [picoparsec](https://bitbucket.org/blamario/picoparsec), a fork of [attoparsec](http://hackage.haskell.org/package/attoparsec).
Test/TestMonoidSubclasses.hs view
@@ -1,5 +1,5 @@ {- - Copyright 2013-2015 Mario Blazevic+ Copyright 2013-2017 Mario Blazevic License: BSD3 (see BSD3-LICENSE.txt file) -}@@ -18,7 +18,7 @@ import Control.Applicative (Applicative(..), liftA2) import Data.Functor ((<$>))-import Data.Foldable (toList)+import Data.Foldable (foldMap, toList) import Data.Int (Int8, Int32) import qualified Data.Foldable as Foldable import Data.Traversable (Traversable)
monoid-subclasses.cabal view
@@ -1,5 +1,5 @@ Name: monoid-subclasses-Version: 0.4.3.1+Version: 0.4.3.2 Cabal-Version: >= 1.10 Build-Type: Simple Synopsis: Subclasses of Monoid@@ -11,12 +11,12 @@ License: BSD3 License-file: BSD3-LICENSE.txt-Copyright: (c) 2013-2016 Mario Blazevic-Author: Mario Blazevic-Maintainer: Mario Blazevic <blamario@yahoo.com>+Copyright: (c) 2013-2017 Mario Blažević+Author: Mario Blažević+Maintainer: Mario Blažević <blamario@protonmail.com> Homepage: https://github.com/blamario/monoid-subclasses/ Bug-reports: https://github.com/blamario/monoid-subclasses/issues-Extra-Source-Files: README.md+Extra-Source-Files: README.md, CHANGELOG.md Source-repository head type: git location: https://github.com/blamario/monoid-subclasses@@ -37,7 +37,7 @@ bytestring >= 0.9 && < 1.0, containers >= 0.5.7.0 && < 0.6, text >= 0.11 && < 1.3, vector >= 0.9 && < 0.13, primes == 0.2.*, QuickCheck >= 2.9 && < 3, quickcheck-instances >= 0.3.12 && <0.4,- tasty >= 0.7, tasty-quickcheck >= 0.7,+ tasty >= 0.7, tasty-quickcheck >= 0.7 && < 1.0, monoid-subclasses Main-is: Test/TestMonoidSubclasses.hs default-language: Haskell2010