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. class (DistributiveGCDMonoid m, LCMMonoid m) => DistributiveLCMMonoid m

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

  2. class GCDMonoid m => LCMMonoid m

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

  3. class (Monoid m, LeftReductive m, RightReductive m) => OverlappingGCDMonoid m

    monoid-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: Idempotence
    overlap a a == a
    
    Identity
    overlap mempty a == mempty
    
    overlap a mempty == mempty
    

  4. class MonoidNull m => PositiveMonoid m

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

  5. class (IsString t, LeftReductive t, LeftGCDMonoid t, FactorialMonoid t) => TextualMonoid t

    monoid-subclasses Data.Monoid.Textual

    The TextualMonoid class is an extension of FactorialMonoid specialized for monoids that can contain characters. Its methods are generally equivalent to their namesake functions from Data.List and Data.Text, and they satisfy the following laws:

    unfoldr splitCharacterPrefix . fromString == id
    splitCharacterPrefix . primePrefix == fmap (\(c, t)-> (c, mempty)) . splitCharacterPrefix
    
    map f . fromString == fromString . List.map f
    concatMap (fromString . f) . fromString == fromString . List.concatMap f
    
    foldl  ft fc a . fromString == List.foldl  fc a
    foldr  ft fc a . fromString == List.foldr  fc a
    foldl' ft fc a . fromString == List.foldl' fc a
    
    scanl f c . fromString == fromString . List.scanl f c
    scanr f c . fromString == fromString . List.scanr f c
    mapAccumL f a . fromString == fmap fromString . List.mapAccumL f a
    mapAccumL f a . fromString == fmap fromString . List.mapAccumL f a
    
    takeWhile pt pc . fromString == fromString . takeWhile pc
    dropWhile pt pc . fromString == fromString . dropWhile pc
    
    mconcat . intersperse (singleton c) . split (== c) == id
    find p . fromString == List.find p
    elem c . fromString == List.elem c
    
    A TextualMonoid may contain non-character data insterspersed between its characters. Every class method that returns a modified TextualMonoid instance generally preserves this non-character data. Methods like foldr can access both the non-character and character data and expect two arguments for the two purposes. For each of these methods there is also a simplified version with underscore in name (like foldr_) that ignores the non-character data. All of the following expressions are identities:
    map id
    concatMap singleton
    foldl  (<>) (\a c-> a <> singleton c) mempty
    foldr  (<>) ((<>) . singleton) mempty
    foldl' (<>) (\a c-> a <> singleton c) mempty
    scanl1 (const id)
    scanr1 const
    uncurry (mapAccumL (,))
    uncurry (mapAccumR (,))
    takeWhile (const True) (const True)
    dropWhile (const False) (const False)
    toString undefined . fromString
    toText undefined . fromText
    

  6. class AppendSemigroup sh => AppendMonoid sh

    comfort-array Data.Array.Comfort.Shape

    No documentation available.

  7. WrapMonoid :: m -> WrappedMonoid m

    base-compat-batteries Data.Semigroup.Compat

    No documentation available.

  8. newtype WrappedMonoid m

    base-compat-batteries Data.Semigroup.Compat

    Provide a Semigroup for an arbitrary Monoid. NOTE: This is not needed anymore since Semigroup became a superclass of Monoid in base-4.11 and this newtype be deprecated at some point in the future.

  9. stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a

    base-compat-batteries Data.Semigroup.Compat

    This is a valid definition of stimes for an idempotent Monoid. When x <> x = x, this definition should be preferred, because it works in <math> rather than <math>

  10. stimesMonoid :: (Integral b, Monoid a) => b -> a -> a

    base-compat-batteries Data.Semigroup.Compat

    This is a valid definition of stimes for a Monoid. Unlike the default definition of stimes, it is defined for 0 and so it should be preferred where possible.

Page 10 of many | Previous | Next