Hoogle Search

Within LTS Haskell 24.66 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()

    protolude Protolude

    Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM. mapM_ is just like traverse_, but specialised to monadic actions.

  2. mapMaybe :: (a -> Maybe b) -> [a] -> [b]

    protolude Protolude

    The mapMaybe function is a version of map which can throw out elements. In particular, the functional argument returns something of type Maybe b. If this is Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.

    Examples

    Using mapMaybe f x is a shortcut for catMaybes $ map f x in most cases:
    >>> import GHC.Internal.Text.Read ( readMaybe )
    
    >>> let readMaybeInt = readMaybe :: String -> Maybe Int
    
    >>> mapMaybe readMaybeInt ["1", "Foo", "3"]
    [1,3]
    
    >>> catMaybes $ map readMaybeInt ["1", "Foo", "3"]
    [1,3]
    
    If we map the Just constructor, the entire list should be returned:
    >>> mapMaybe Just [1,2,3]
    [1,2,3]
    

  3. mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])

    protolude Protolude.Monad

    The mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state monad.

  4. mapo :: (forall y . () => (Fix f -> y) -> (x -> y) -> x -> f y) -> x -> Fix f

    recursion-schemes Data.Functor.Foldable

    Mendler-style corecursion

  5. mapMaybeNoNull :: (a -> Maybe b) -> MonoidalMap token a -> Maybe (MonoidalMap token b)

    reflex Data.AppendMap

    Like mapMaybe but indicates whether the resulting container is empty

  6. mapPartitionEithers :: Map k (Either a b) -> (Map k a, Map k b)

    reflex Data.Map.Misc

    Deprecated: Use mapEither instead

  7. mapMapWithAdjustWithMove :: (Adjustable t m, Ord k) => (k -> v -> m v') -> Map k v -> Event t (PatchMapWithMove k v) -> m (Map k v', Event t (PatchMapWithMove k v'))

    reflex Reflex.Adjustable.Class

    Traverses a Map, running the provided Adjustable action. The provided Event of patches to the Map can add, remove, update, move, or swap values.

  8. mapAccum :: (Accumulator t f, MonadHold t m, MonadFix m) => (a -> b -> (a, c)) -> a -> Event t b -> m (f a, Event t c)

    reflex Reflex.Class

    No documentation available.

  9. mapAccumM :: (Accumulator t f, MonadHold t m, MonadFix m) => (a -> b -> PushM t (a, c)) -> a -> Event t b -> m (f a, Event t c)

    reflex Reflex.Class

    No documentation available.

  10. mapAccumMaybe :: (Accumulator t f, MonadHold t m, MonadFix m) => (a -> b -> (Maybe a, Maybe c)) -> a -> Event t b -> m (f a, Event t c)

    reflex Reflex.Class

    No documentation available.

Page 162 of many | Previous | Next