Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It is sometimes useful to consider partial semigroups that also have an identity element, say
pmempty
. Many, but not all, partial semigroups that have instances in this library are also partial monoids, with some identity element. This patch introduces a typeclass,PartialMonoid
, that represents such types. This typeclass is meant to directly mirror the standardMonoid
typeclass, prependingpm
to each function in the standard typeclass and changing their types to represent partiality. The only deviation here is removingpmappend
from the typeclass, since this is necessarily an alias for<>?
specialized to monoids; unlike with the standardmappend
, by moving this out of the typeclass, we avoid any possibility of unlawful instances wherepmappend ≢ (<>?)
.This patch tags each addition with a
@since 0.7.0.0
Haddock annotation, on the assumption that these changes will be included in a new release of the library with that version.Fixes #13.