Hoogle Search
Within LTS Haskell 24.65 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
class LeftGCDMonoid m =>
LeftDistributiveGCDMonoid mmonoid-subclasses Data.Monoid.GCD Class of left GCD monoids with left-distributivity. In addition to the general LeftGCDMonoid laws, instances of this class must also satisfy the following law:
commonPrefix (a <> b) (a <> c) == a <> commonPrefix b c
class (Monoid m, LeftReductive m) =>
LeftGCDMonoid mmonoid-subclasses Data.Monoid.GCD Class of monoids capable of finding the equivalent of greatest common divisor on the left side of two monoidal values. The following laws must be respected:
stripCommonPrefix a b == (p, a', b') where p = commonPrefix a b Just a' = stripPrefix p a Just b' = stripPrefix p b p == commonPrefix a b && p <> a' == a && p <> b' == b where (p, a', b') = stripCommonPrefix a b
Furthermore, commonPrefix must return the unique greatest common prefix that contains, as its prefix, any other prefix x of both values:not (x `isPrefixOf` a && x `isPrefixOf` b) || x `isPrefixOf` commonPrefix a b
and it cannot itself be a suffix of any other common prefix y of both values:not (y `isPrefixOf` a && y `isPrefixOf` b && commonPrefix a b `isSuffixOf` y)
In addition, the commonPrefix operation must satisfy the following properties: IdempotencecommonPrefix a a == a
IdentitycommonPrefix mempty a == mempty
commonPrefix a mempty == mempty
CommutativitycommonPrefix a b == commonPrefix b a
AssociativitycommonPrefix (commonPrefix a b) c == commonPrefix a (commonPrefix b c)
class (Monoid m, LeftReductive m, RightReductive m) =>
OverlappingGCDMonoid mmonoid-subclasses Data.Monoid.GCD Class of monoids for which the greatest overlap can be found between any two values, such that
a == a' <> overlap a b b == overlap a b <> b'
The methods must satisfy the following laws:stripOverlap a b == (stripSuffixOverlap b a, overlap a b, stripPrefixOverlap a b) stripSuffixOverlap b a <> overlap a b == a overlap a b <> stripPrefixOverlap a b == b
The result of overlap a b must be the largest prefix of b and suffix of a, in the sense that it contains any other value x that satifies the property (x isPrefixOf b) && (x isSuffixOf a):∀x. (x `isPrefixOf` b && x `isSuffixOf` a) => (x `isPrefixOf` overlap a b && x `isSuffixOf` overlap a b)
and it must be unique so there's no other value y that satisfies the same properties for every such x:∀y. ((∀x. (x `isPrefixOf` b && x `isSuffixOf` a) => x `isPrefixOf` y && x `isSuffixOf` y) => y == overlap a b)
In addition, the overlap operation must satisfy the following properties: Idempotenceoverlap a a == a
Identityoverlap mempty a == mempty
overlap a mempty == mempty
class RightGCDMonoid m =>
RightDistributiveGCDMonoid mmonoid-subclasses Data.Monoid.GCD Class of right GCD monoids with right-distributivity. In addition to the general RightGCDMonoid laws, instances of this class must also satisfy the following law:
commonSuffix (a <> c) (b <> c) == commonSuffix a b <> c
class (Monoid m, RightReductive m) =>
RightGCDMonoid mmonoid-subclasses Data.Monoid.GCD Class of monoids capable of finding the equivalent of greatest common divisor on the right side of two monoidal values. The following laws must be respected:
stripCommonSuffix a b == (a', b', s) where s = commonSuffix a b Just a' = stripSuffix p a Just b' = stripSuffix p b s == commonSuffix a b && a' <> s == a && b' <> s == b where (a', b', s) = stripCommonSuffix a b
Furthermore, commonSuffix must return the unique greatest common suffix that contains, as its suffix, any other suffix x of both values:not (x `isSuffixOf` a && x `isSuffixOf` b) || x `isSuffixOf` commonSuffix a b
and it cannot itself be a prefix of any other common suffix y of both values:not (y `isSuffixOf` a && y `isSuffixOf` b && commonSuffix a b `isPrefixOf` y)
In addition, the commonSuffix operation must satisfy the following properties: IdempotencecommonSuffix a a == a
IdentitycommonSuffix mempty a == mempty
commonSuffix a mempty == mempty
CommutativitycommonSuffix a b == commonSuffix b a
AssociativitycommonSuffix (commonSuffix a b) c == commonSuffix a (commonSuffix b c)
class (DistributiveGCDMonoid m, LCMMonoid m) =>
DistributiveLCMMonoid mmonoid-subclasses Data.Monoid.LCM Class of commutative LCM monoids with distributivity. In addition to the general LCMMonoid laws, instances of this class must also satisfy the following laws: The lcm operation itself must be both left-distributive and right-distributive:
lcm (a <> b) (a <> c) == a <> lcm b c
lcm (a <> c) (b <> c) == lcm a b <> c
The lcm and gcd operations must distribute over one another:lcm a (gcd b c) == gcd (lcm a b) (lcm a c)
gcd a (lcm b c) == lcm (gcd a b) (gcd a c)
class GCDMonoid m =>
LCMMonoid mmonoid-subclasses Data.Monoid.LCM Class of Abelian monoids that allow the least common multiple to be found for any two given values. Operations must satisfy the following laws: Reductivity
isJust (lcm a b </> a)
isJust (lcm a b </> b)
Uniquenessall isJust [ c </> a , c </> b , lcm a b </> c ] ==> (lcm a b == c)
Idempotencelcm a a == a
Identitylcm mempty a == a
lcm a mempty == a
Commutativitylcm a b == lcm b a
Associativitylcm (lcm a b) c == lcm a (lcm b c)
Absorptionlcm a (gcd a b) == a
gcd a (lcm a b) == a
class (Monoid m, LeftReductive m, RightReductive m) =>
OverlappingGCDMonoid mmonoid-subclasses Data.Monoid.Monus Class of monoids for which the greatest overlap can be found between any two values, such that
a == a' <> overlap a b b == overlap a b <> b'
The methods must satisfy the following laws:stripOverlap a b == (stripSuffixOverlap b a, overlap a b, stripPrefixOverlap a b) stripSuffixOverlap b a <> overlap a b == a overlap a b <> stripPrefixOverlap a b == b
The result of overlap a b must be the largest prefix of b and suffix of a, in the sense that it contains any other value x that satifies the property (x isPrefixOf b) && (x isSuffixOf a):∀x. (x `isPrefixOf` b && x `isSuffixOf` a) => (x `isPrefixOf` overlap a b && x `isSuffixOf` overlap a b)
and it must be unique so there's no other value y that satisfies the same properties for every such x:∀y. ((∀x. (x `isPrefixOf` b && x `isSuffixOf` a) => x `isPrefixOf` y && x `isSuffixOf` y) => y == overlap a b)
In addition, the overlap operation must satisfy the following properties: Idempotenceoverlap a a == a
Identityoverlap mempty a == mempty
overlap a mempty == mempty
class Monoid m =>
MonoidNull mmonoid-subclasses Data.Monoid.Null Extension of Monoid that allows testing a value for equality with mempty. The following law must hold:
null x == (x == mempty)
Furthermore, the performance of this method should be constant, i.e., independent of the length of its argument.class MonoidNull m =>
PositiveMonoid mmonoid-subclasses Data.Monoid.Null Subclass of Monoid for types whose values have no inverse, with the exception of mempty. More formally, the class instances must satisfy the following law:
null (x <> y) == (null x && null y)