prologue-3.1.6: Better, more general Prelude exporting common utilities.

Safe HaskellNone
LanguageHaskell2010

Prologue.Data.Maybe

Synopsis

Documentation

justIf :: Bool -> a -> Maybe a Source #

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

fromMaybe :: a -> Maybe a -> a Source #

Warning: use fromJust instead

fromJust :: a -> Maybe a -> a Source #

fromJustM :: Applicative m => m a -> Maybe a -> m a Source #

unsafeFromJust :: Maybe a -> a Source #

Warning: Do not use in production code

withJust :: (Applicative m, Mempty out) => Maybe a -> (a -> m out) -> m out Source #

withJust_ :: Applicative m => Maybe a -> (a -> m out) -> m () Source #

withJustM :: (Monad m, Mempty out) => m (Maybe a) -> (a -> m out) -> m out Source #

withJustM_ :: Monad m => m (Maybe a) -> (a -> m out) -> m () Source #

whenJust :: (Applicative m, Mempty out) => Maybe a -> m out -> m out Source #

whenJust_ :: Applicative m => Maybe a -> m out -> m () Source #

whenJustM :: (Monad m, Mempty out) => m (Maybe a) -> m out -> m out Source #

whenJustM_ :: Monad m => m (Maybe a) -> m out -> m () Source #

whenNothing :: (Applicative m, Mempty out) => Maybe a -> m out -> m out Source #

whenNothing_ :: Applicative m => Maybe a -> m out -> m () Source #

whenNothingM :: (Monad m, Mempty out) => m (Maybe a) -> m out -> m out Source #

whenNothingM_ :: Monad m => m (Maybe a) -> m out -> m () Source #