Module Data.Monoid

Version
April 2025

Library with some useful Monoid instances.

Exported Datatypes:

Exported Datatypes


newtype All

Boolean monoid under (&&)

Constructor:

All :: Bool -> All

Fields:

Known instances:


newtype Any

Boolean monoid under (||)

Constructor:

Any :: Bool -> Any

Fields:

Known instances:


newtype Sum a

Monoid under addition.

Constructor:

Sum :: a -> Sum a

Fields:

  • getSum :: a

Known instances:


newtype Product a

Monoid under multiplication.

Constructor:

Product :: a -> Product a

Fields:

  • getProduct :: a

Known instances:


newtype First a

Maybe monoid returning the leftmost Just value.

Constructor:

First :: (Maybe a) -> First a

Fields:

Known instances:


newtype Last a

Maybe monoid returning the rightmost Just value.

Constructor:

Last :: (Maybe a) -> Last a

Fields:

Known instances: