Closed chshersh closed 7 years ago
Btw, maybe a id
is fromMaybe a
.
@gromakovsky Even better :)
One more convenient function is maybeWithMonoid :: Monoid m => Maybe a -> (a -> m) -> m
. After it maybeToMonoid x
becomes just maybeWithMonoid x id
.
I propose to add next function:
When there was
Foldable
forMaybe
,maybeToMonoid
is justfold
. But I think that this function is useful. And it's behavior and type is clear from name, also what it does and how also clear from type.