Hoogle Search

Within LTS Haskell 24.41 (ghc-9.10.3)

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

  1. mapMaybe :: forall s a b . (a -> Maybe b) -> IntMap s a -> SomeIntMapWith (SupersetProof 'Int s) b

    refined-containers Data.IntMap.Strict.Refined

    Apply a function to all values in a map and collect only the Just results, returning a potentially smaller map.

  2. mapMaybeWithKey :: (Key s -> a -> Maybe b) -> IntMap s a -> SomeIntMapWith (SupersetProof 'Int s) b

    refined-containers Data.IntMap.Strict.Refined

    Apply a function to all values in a map, together with their corresponding keys, and collect only the Just results, returning a potentially smaller map.

  3. mapMaybe :: forall s k a b . (a -> Maybe b) -> Map s k a -> SomeMapWith (SupersetProof 'Regular s) k b

    refined-containers Data.Map.Refined

    Apply a function to all values in a map and collect only the Just results, returning a potentially smaller map.

  4. mapMaybeWithKey :: (Key s k -> a -> Maybe b) -> Map s k a -> SomeMapWith (SupersetProof 'Regular s) k b

    refined-containers Data.Map.Refined

    Apply a function to all values in a map, together with their corresponding keys, and collect only the Just results, returning a potentially smaller map.

  5. mapMaybe :: forall s k a b . (a -> Maybe b) -> Map s k a -> SomeMapWith (SupersetProof 'Regular s) k b

    refined-containers Data.Map.Strict.Refined

    Apply a function to all values in a map and collect only the Just results, returning a potentially smaller map.

  6. mapMaybeWithKey :: (Key s k -> a -> Maybe b) -> Map s k a -> SomeMapWith (SupersetProof 'Regular s) k b

    refined-containers Data.Map.Strict.Refined

    Apply a function to all values in a map, together with their corresponding keys, and collect only the Just results, returning a potentially smaller map.

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

    strict-base-types Data.Maybe.Strict

    Analogous to mapMaybe in Data.Maybe.

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

    verset Verset

    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]
    

  9. data MapMSym0 (a1 :: TyFun a ~> m b t a ~> m t b)

    singletons-base Control.Monad.Singletons

    No documentation available.

  10. data MapMSym1 (a6989586621680752083 :: a ~> m b) (b1 :: TyFun t a m t b)

    singletons-base Control.Monad.Singletons

    No documentation available.

Page 63 of many | Previous | Next