data-extra-2.0.0: Extra utilities for working on Data.* types.

Safe HaskellSafe-Inferred

Data.Maybe.Extra

Description

Extra functions for dealing with Maybe.

Synopsis

Documentation

whenMaybe :: Monad m => Bool -> m a -> m (Maybe a)Source

When the predicate is true, return maybe the action's return value.

whenJust :: Monad m => Maybe a -> (a -> m c) -> m ()Source

When a value is Just, do something with it, monadically.