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. mapMaybe :: (a -> Maybe b) -> [a] -> [b]

    strict-base-types Data.Maybe.Strict

    Analogous to mapMaybe in Data.Maybe.

  2. mapMaybe :: (Unboxable a, Unboxable b) => (a -> Maybe b) -> Vector a -> Vector b

    unboxing-vector Data.Vector.Unboxing

    No documentation available.

  3. mapMaybe :: Interval k e => (a -> Maybe b) -> IntervalMap k a -> IntervalMap k b

    IntervalMap Data.IntervalMap.Generic.Lazy

    O(n). Map values and collect the Just results.

  4. mapMaybe :: Interval k e => (a -> Maybe b) -> IntervalMap k a -> IntervalMap k b

    IntervalMap Data.IntervalMap.Generic.Strict

    O(n). Map values and collect the Just results.

  5. mapMaybe :: Interval k e => (a -> Maybe b) -> IntervalMap k a -> IntervalMap k b

    IntervalMap Data.IntervalMap.Lazy

    O(n). Map values and collect the Just results.

  6. mapMaybe :: Interval k e => (a -> Maybe b) -> IntervalMap k a -> IntervalMap k b

    IntervalMap Data.IntervalMap.Strict

    O(n). Map values and collect the Just results.

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

    classy-prelude-yesod ClassyPrelude.Yesod

    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]
    

  8. mapMaybe :: Fractional prob => (a -> Maybe b) -> T prob a -> T prob b

    probability Numeric.Probability.Distribution

    No documentation available.

  9. mapMaybe :: forall s k a b . (a -> Maybe b) -> HashMap s k a -> SomeHashMapWith (SupersetProof 'Hashed s) k b

    refined-containers Data.HashMap.Refined

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

  10. mapMaybe :: forall s k a b . (a -> Maybe b) -> HashMap s k a -> SomeHashMapWith (SupersetProof 'Hashed s) k b

    refined-containers Data.HashMap.Strict.Refined

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

Page 12 of many | Previous | Next