Haskell Hierarchical Libraries (base package)ContentsIndex
Portabilitynon-portable (requires extended type classes)

Declaration of the Monoid class, and instances for list and functions.

Inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995.

class Monoid a where
mempty :: a
mappend :: a -> a -> a
mconcat :: [a] -> a
class Monoid a where
The monoid class. A minimal complete definition must supply mempty and mappend, and these should satisfy the monoid laws.
mempty :: a
Identity of mappend
mappend :: a -> a -> a
An associative operation
mconcat :: [a] -> a
Fold a list using the monoid. For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.
show/hide Instances
Monoid IntSet
Monoid Ordering
Monoid ()
(Monoid a, Monoid b) => Monoid (a, b)
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)
Monoid (a -> a)
Ord a => Monoid (IntMap a)
Ord a => Monoid (Set a)
Monoid [a]
Ord k => Monoid (Map k v)
Produced by Haddock version 0.7