Hoogle Search

Within LTS Haskell 24.4 (ghc-9.10.2)

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

  1. mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b)

    prelude-compat Prelude2010

    Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.

    Examples

    mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.

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

    prelude-compat Prelude2010

    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. mapBoth :: (a -> c) -> (b -> d) -> Either a b -> Either c d

    rebase Rebase.Prelude

    The mapBoth function takes two functions and applies the first if iff the value takes the form Left _ and the second if the value takes the form Right _. Using Data.Bifunctor:

    mapBoth = bimap
    
    Using Control.Arrow:
    mapBoth = (+++)
    
    >>> mapBoth (*2) (*3) (Left 4)
    Left 8
    
    >>> mapBoth (*2) (*3) (Right 4)
    Right 12
    

  4. mapCont :: (r -> r) -> Cont r a -> Cont r a

    rebase Rebase.Prelude

    Apply a function to transform the result of a continuation-passing computation.

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

    rebase Rebase.Prelude

    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

    rebase Rebase.Prelude

    Map the unwrapped computation using the given function.

  7. mapMaybeT :: (m (Maybe a) -> n (Maybe b)) -> MaybeT m a -> MaybeT n b

    rebase Rebase.Prelude

    Transform the computation inside a MaybeT.

  8. mapReader :: (a -> b) -> Reader r a -> Reader r b

    rebase Rebase.Prelude

    Transform the value returned by a Reader.

  9. mapReaderT :: (m a -> n b) -> ReaderT r m a -> ReaderT r n b

    rebase Rebase.Prelude

    Transform the computation inside a ReaderT.

  10. mapState :: ((a, s) -> (b, s)) -> State s a -> State s b

    rebase Rebase.Prelude

    Map both the return value and final state of a computation using the given function.

Page 9 of many | Previous | Next