Hoogle Search

Within LTS Haskell 24.25 (ghc-9.10.3)

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

  1. liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c

    ghc-lib GHC.HsToCore.Monad

    Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.

    Example

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)
    
    >>> liftA2 (+) [1, 2, 3] [4, 5, 6]
    [5,6,7,6,7,8,7,8,9]
    

  2. liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c

    verset Verset

    Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.

    Example

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)
    
    >>> liftA2 (+) [1, 2, 3] [4, 5, 6]
    [5,6,7,6,7,8,7,8,9]
    

  3. liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c

    xmonad-contrib XMonad.Config.Prime

    Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.

    Example

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)
    
    >>> liftA2 (+) [1, 2, 3] [4, 5, 6]
    [5,6,7,6,7,8,7,8,9]
    

  4. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    base Control.Monad

    Promote a function to a monad, scanning the monadic arguments from left to right.

    Examples

    >>> liftM2 (+) [0,1] [0,2]
    [0,2,1,3]
    
    >>> liftM2 (+) (Just 1) Nothing
    Nothing
    
    >>> liftM2 (+) (+ 3) (* 2) 5
    18
    

  5. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    base GHC.Base

    Promote a function to a monad, scanning the monadic arguments from left to right.

    Examples

    >>> liftM2 (+) [0,1] [0,2]
    [0,2,1,3]
    
    >>> liftM2 (+) (Just 1) Nothing
    Nothing
    
    >>> liftM2 (+) (+ 3) (* 2) 5
    18
    

  6. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    rio RIO.Prelude

    Promote a function to a monad, scanning the monadic arguments from left to right.

    Examples

    >>> liftM2 (+) [0,1] [0,2]
    [0,2,1,3]
    
    >>> liftM2 (+) (Just 1) Nothing
    Nothing
    
    >>> liftM2 (+) (+ 3) (* 2) 5
    18
    

  7. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    Cabal-syntax Distribution.Compat.Prelude

    No documentation available.

  8. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    streaming Streaming

    Promote a function to a monad, scanning the monadic arguments from left to right.

    Examples

    >>> liftM2 (+) [0,1] [0,2]
    [0,2,1,3]
    
    >>> liftM2 (+) (Just 1) Nothing
    Nothing
    
    >>> liftM2 (+) (+ 3) (* 2) 5
    18
    

  9. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    base-compat-batteries Control.Monad.Compat

    Promote a function to a monad, scanning the monadic arguments from left to right.

    Examples

    >>> liftM2 (+) [0,1] [0,2]
    [0,2,1,3]
    
    >>> liftM2 (+) (Just 1) Nothing
    Nothing
    
    >>> liftM2 (+) (+ 3) (* 2) 5
    18
    

  10. liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r

    ghc-internal GHC.Internal.Base

    Promote a function to a monad, scanning the monadic arguments from left to right.

    Examples

    >>> liftM2 (+) [0,1] [0,2]
    [0,2,1,3]
    
    >>> liftM2 (+) (Just 1) Nothing
    Nothing
    
    >>> liftM2 (+) (+ 3) (* 2) 5
    18
    

Page 10 of many | Previous | Next