Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

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

  1. mapMaybe :: Ord k => (a -> Maybe b) -> Map k a -> Map k b

    dhall Dhall.Map

    Transform all values in a Map using the supplied function, deleting the key if the function returns Nothing

    >>> mapMaybe Data.Maybe.listToMaybe (fromList [("C",[1]),("B",[]),("A",[3])])
    fromList [("C",1),("A",3)]
    

  2. mapMOf :: LensLike (WrappedMonad m) s t a b -> (a -> m b) -> s -> m t

    dhall Dhall.Optics

    Identical to Control.Lens.mapMOf

  3. mapMaybe :: (a -> Maybe b) -> [a] -> [b]

    foundation Foundation

    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. mapM_ :: (Mappable col, Applicative m, Monad m) => (a -> m b) -> col a -> m ()

    foundation Foundation.Collection

    Evaluate each action in the collection from left to right, and ignore the results. For a version that doesn't ignore the results see sequenceA. sequenceA_ :: (Mappable col, Applicative f) => col (f a) -> f () sequenceA_ col = sequenceA col *> pure () Map each element of a collection 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.

  5. mapM_ :: (Context a, Monad m) => (a -> m b) -> Matrix a -> m ()

    matrices Data.Matrix

    No documentation available.

  6. mapM_ :: forall (v :: Type -> Type) a m b . (Vector v a, Monad m) => (a -> m b) -> Matrix v a -> m ()

    matrices Data.Matrix.Generic

    No documentation available.

  7. mapM_ :: (Context a, Monad m) => (a -> m b) -> Matrix a -> m ()

    matrices Data.Matrix.Storable

    No documentation available.

  8. mapM_ :: (Context a, Monad m) => (a -> m b) -> Matrix a -> m ()

    matrices Data.Matrix.Unboxed

    No documentation available.

  9. mapMaybe :: (a -> Maybe b) -> MonoidalIntMap a -> MonoidalIntMap b

    monoidal-containers Data.IntMap.Monoidal

    No documentation available.

  10. mapMaybeWithKey :: (Int -> a -> Maybe b) -> MonoidalIntMap a -> MonoidalIntMap b

    monoidal-containers Data.IntMap.Monoidal

    No documentation available.

Page 39 of many | Previous | Next