nikita-volkov/typeclasses/1.2.0

NOTE: the latest version is 1.8.0

Typeclasses.Extensions.Maybe

Extensions to the Maybe API, which utilise typeclasses.

fold : Monoid a -> Maybe a -> a

Extract a value or use the Monoid's identity.

foldMap : Monoid b -> (a -> b) -> Maybe a -> b

Map the element of Maybe to a type which has an instance of Monoid, or use its identity, when Maybe is Nothing.