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.

  1. type CommutativeMonoid m = (Monoid m, Commutative m)

    monoid-subclasses Data.Monoid.Cancellative

    No documentation available.

  2. type LeftCancellativeMonoid m = (Monoid m, LeftCancellative m)

    monoid-subclasses Data.Monoid.Cancellative

    No documentation available.

  3. type LeftReductiveMonoid m = (Monoid m, LeftReductive m)

    monoid-subclasses Data.Monoid.Cancellative

    No documentation available.

  4. type ReductiveMonoid m = (Monoid m, Reductive m)

    monoid-subclasses Data.Monoid.Cancellative

    No documentation available.

  5. type RightCancellativeMonoid m = (Monoid m, RightCancellative m)

    monoid-subclasses Data.Monoid.Cancellative

    No documentation available.

  6. type RightReductiveMonoid m = (Monoid m, RightReductive m)

    monoid-subclasses Data.Monoid.Cancellative

    No documentation available.

  7. class (Factorial m, MonoidNull m) => FactorialMonoid m

    monoid-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.

  8. type StableFactorialMonoid m = (StableFactorial m, FactorialMonoid m, PositiveMonoid m)

    monoid-subclasses Data.Monoid.Factorial

    Deprecated: Use Data.Semigroup.Factorial.StableFactorial instead.

  9. class (LeftDistributiveGCDMonoid m, RightDistributiveGCDMonoid m, GCDMonoid m) => DistributiveGCDMonoid m

    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
    

  10. class (Monoid m, Commutative m, Reductive m, LeftGCDMonoid m, RightGCDMonoid m, OverlappingGCDMonoid m) => GCDMonoid m

    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: Uniqueness
    all isJust
    [ a </> c
    , b </> c
    , c </> gcd a b
    ]
    ==>
    (c == gcd a b)
    
    Idempotence
    gcd a a == a
    
    Identity
    gcd mempty a == mempty
    
    gcd a mempty == mempty
    
    Commutativity
    gcd a b == gcd b a
    
    Associativity
    gcd (gcd a b) c == gcd a (gcd b c)
    

Page 22 of many | Previous | Next