Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
type
CommutativeMonoid m = (Monoid m, Commutative m)monoid-subclasses Data.Monoid.Cancellative No documentation available.
type
LeftCancellativeMonoid m = (Monoid m, LeftCancellative m)monoid-subclasses Data.Monoid.Cancellative No documentation available.
type
LeftReductiveMonoid m = (Monoid m, LeftReductive m)monoid-subclasses Data.Monoid.Cancellative No documentation available.
type
ReductiveMonoid m = (Monoid m, Reductive m)monoid-subclasses Data.Monoid.Cancellative No documentation available.
type
RightCancellativeMonoid m = (Monoid m, RightCancellative m)monoid-subclasses Data.Monoid.Cancellative No documentation available.
type
RightReductiveMonoid m = (Monoid m, RightReductive m)monoid-subclasses Data.Monoid.Cancellative No documentation available.
class (Factorial m, MonoidNull m) =>
FactorialMonoid mmonoid-subclasses Data.Monoid.Factorial Class of monoids that can be split into irreducible (i.e., atomic or prime) factors in a unique way. Note that mempty is not considered a factor. Factors of a Product are literally its prime factors:
factors (Product 12) == [Product 2, Product 2, Product 3]
Factors of a list are not its elements but all its single-item sublists:factors "abc" == ["a", "b", "c"]
The methods of this class satisfy the following laws in addition to those of Factorial:null == List.null . factors factors == unfoldr splitPrimePrefix == List.reverse . unfoldr (fmap swap . splitPrimeSuffix) reverse == mconcat . List.reverse . factors primePrefix == maybe mempty fst . splitPrimePrefix primeSuffix == maybe mempty snd . splitPrimeSuffix inits == List.map mconcat . List.inits . factors tails == List.map mconcat . List.tails . factors span p m == (mconcat l, mconcat r) where (l, r) = List.span p (factors m) List.all (List.all (not . pred) . factors) . split pred mconcat . intersperse prime . split (== prime) == id splitAt i m == (mconcat l, mconcat r) where (l, r) = List.splitAt i (factors m) spanMaybe () (const $ bool Nothing (Maybe ()) . p) m == (takeWhile p m, dropWhile p m, ()) spanMaybe s0 (\s m-> Just $ f s m) m0 == (m0, mempty, foldl f s0 m0) let (prefix, suffix, s') = spanMaybe s f m foldMaybe = foldl g (Just s) g s m = s >>= flip f m in all ((Nothing ==) . foldMaybe) (inits prefix) && prefix == last (filter (isJust . foldMaybe) $ inits m) && Just s' == foldMaybe prefix && m == prefix <> suffix
A minimal instance definition should implement splitPrimePrefix for performance reasons, and other methods where beneficial.type
StableFactorialMonoid m = (StableFactorial m, FactorialMonoid m, PositiveMonoid m)monoid-subclasses Data.Monoid.Factorial Deprecated: Use Data.Semigroup.Factorial.StableFactorial instead.
-
monoid-subclasses Data.Monoid.GCD Class of commutative GCD monoids with symmetric distributivity. In addition to the general GCDMonoid laws, instances of this class must also satisfy the following laws:
gcd (a <> b) (a <> c) == a <> gcd b c
gcd (a <> c) (b <> c) == gcd a b <> c
-
monoid-subclasses Data.Monoid.GCD Class of Abelian monoids that allow the greatest common divisor to be found for any two given values. The operations must satisfy the following laws:
gcd a b == commonPrefix a b == commonSuffix a b Just a' = a </> p && Just b' = b </> p where p = gcd a b
In addition, the gcd operation must satisfy the following properties: Uniquenessall isJust [ a </> c , b </> c , c </> gcd a b ] ==> (c == gcd a b)
Idempotencegcd a a == a
Identitygcd mempty a == mempty
gcd a mempty == mempty
Commutativitygcd a b == gcd b a
Associativitygcd (gcd a b) c == gcd a (gcd b c)