Hoogle Search
Within LTS Haskell 24.38 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
liftMaybe :: Alternative f => Maybe a -> f aAgda Agda.Utils.Maybe Lift a maybe to an Alternative.
spanMaybe :: (a -> Maybe b) -> [a] -> ([b], [a])Agda Agda.Utils.Maybe Like span, takes the prefix of a list satisfying a predicate. Returns the run of Justs until the first Nothing, and the tail of the list.
unionMaybeWith :: (a -> a -> a) -> Maybe a -> Maybe a -> Maybe aAgda Agda.Utils.Maybe unionWith for collections of size <= 1.
unionsMaybeWith :: (a -> a -> a) -> [Maybe a] -> Maybe aAgda Agda.Utils.Maybe unionsWith for collections of size <= 1.
unzipMaybe :: Maybe (a, b) -> (Maybe a, Maybe b)Agda Agda.Utils.Maybe Unzipping a list of length <= 1.
caseMaybe :: Maybe a -> b -> (a -> b) -> bAgda Agda.Utils.Maybe.Strict Version of maybe with different argument ordering. Often, we want to case on a Maybe, do something interesting in the Just case, but only a default action in the Nothing case. Then, the argument ordering of caseMaybe is preferable.
caseMaybe m err f = flip (maybe err) m f
caseMaybeM :: Monad m => m (Maybe a) -> m b -> (a -> m b) -> m bAgda Agda.Utils.Maybe.Strict Monadic version of caseMaybe. That is, maybeM with a different argument ordering.
filterMaybe :: (a -> Bool) -> a -> Maybe aAgda Agda.Utils.Maybe.Strict Filtering a singleton list.
filterMaybe p a = listToMaybe (filter p [a])
forMaybe :: [a] -> (a -> Maybe b) -> [b]Agda Agda.Utils.Maybe.Strict Version of mapMaybe with different argument ordering.
fromMaybeM :: Monad m => m a -> m (Maybe a) -> m aAgda Agda.Utils.Maybe.Strict Monadic version of fromMaybe.