Hoogle Search

Within LTS Haskell 24.27 (ghc-9.10.3)

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

  1. mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a

    protolude Protolude

    This function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".

  2. 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.

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

  4. 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.

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

    recursion-schemes Data.Functor.Foldable

    Mendler-style corecursion

  6. 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

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

  8. mapR :: Ord c => (b -> c) -> Bimap a b -> Bimap a c

    bimap Data.Bimap

    O(n*log n) Map a function over all the right keys in the map. Version 0.3

  9. mapCArrayInPlace :: (Ix i, Storable e) => (e -> e) -> CArray i e -> CArray i e

    carray Data.Array.CArray.Base

    In-place map on CArray. Note that this is IN PLACE so you should not retain any reference to the original. It flagrantly breaks referential transparency!

  10. mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a

    graphviz Data.GraphViz.Exception

    This function maps one exception into another as proposed in the paper "A semantics for imprecise exceptions".

Page 161 of many | Previous | Next