Hoogle Search

Within LTS Haskell 24.26 (ghc-9.10.3)

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

  1. mapUnliftedArray :: (PrimUnlifted a, PrimUnlifted b) => (a -> b) -> UnliftedArray a -> UnliftedArray b

    primitive-unlifted Data.Primitive.Unlifted.Array

    Map over the elements of an UnliftedArray.

  2. mapUnliftedArray :: (PrimUnlifted a, PrimUnlifted b) => (a -> b) -> UnliftedArray a -> UnliftedArray b

    primitive-unlifted Data.Primitive.Unlifted.Array.ST

    Map over the elements of an UnliftedArray.

  3. mapSmallUnliftedArray :: (PrimUnlifted a, PrimUnlifted b) => (a -> b) -> SmallUnliftedArray a -> SmallUnliftedArray b

    primitive-unlifted Data.Primitive.Unlifted.SmallArray

    Map over the elements of an SmallUnliftedArray.

  4. mapSmallUnliftedArray :: (PrimUnlifted a, PrimUnlifted b) => (a -> b) -> SmallUnliftedArray a -> SmallUnliftedArray b

    primitive-unlifted Data.Primitive.Unlifted.SmallArray.ST

    Map over the elements of an SmallUnliftedArray.

  5. mapExcept :: (Either e a -> Either e' b) -> Except e a -> Except e' b

    protolude Protolude

    Map the unwrapped computation using the given function.

  6. mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b

    protolude Protolude

    Map the unwrapped computation using the given function.

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

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

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

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

Page 160 of many | Previous | Next