Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. 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]
    

  2. mapMonotonic :: (a -> c) -> Bimap a b -> Bimap c b

    bimap Data.Bimap

    O(n). Map a strictly increasing function over all left keys in the map. The precondition is not checked. Version 0.3

  3. mapMonotonicR :: (b -> c) -> Bimap a b -> Bimap a c

    bimap Data.Bimap

    O(n). Map a strictly increasing function over all right keys in the map. The precondition is not checked. Version 0.3

  4. mapMixedAmount :: (Amount -> Amount) -> MixedAmount -> MixedAmount

    hledger-lib Hledger.Data.Amount

    Apply a transform to a mixed amount's component Amounts.

  5. mapM' :: Monad f => (a -> f b) -> [a] -> f [b]

    hledger-lib Hledger.Utils

    Like mapM but uses sequence'.

  6. mapMaybe :: (a -> Maybe b) -> Infinite a -> Infinite b

    infinite-list Data.List.Infinite

    Apply a function to every element of an infinite list and collect Just results. This function isn't productive (e. g., head . mapMaybe f won't terminate), if no elements of the input list result in Just.

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

    numeric-prelude NumericPrelude

    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.

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

    numeric-prelude NumericPrelude.Base

    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.

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

    numhask NumHask.Prelude

    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.

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

    numhask NumHask.Prelude

    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.

Page 32 of many | Previous | Next