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.

  1. mapInstr :: forall instr1 instr2 (m :: Type -> Type) a . Monad m => (forall x . () => instr1 x -> instr2 x) -> ProgramT instr1 m a -> ProgramT instr2 m a

    operational Control.Monad.Operational

    Extend a mapping of instructions to a mapping of ProgramT.

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

    primitive-unlifted Data.Primitive.Unlifted.Array

    Map over the elements of an UnliftedArray.

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

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

    primitive-unlifted Data.Primitive.Unlifted.SmallArray

    Map over the elements of an SmallUnliftedArray.

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

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

    protolude Protolude

    Map the unwrapped computation using the given function.

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

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

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

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

Page 161 of many | Previous | Next