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 :: (a -> Maybe b) -> Word64Map a -> Word64Map b

    ghc GHC.Data.Word64Map.Lazy

    Map values and collect the Just results.

    let f x = if x == "a" then Just "new a" else Nothing
    mapMaybe f (fromList [(5,"a"), (3,"b")]) == singleton 5 "new a"
    

  2. mapMaybe :: (a -> Maybe b) -> Word64Map a -> Word64Map b

    ghc GHC.Data.Word64Map.Strict

    Map values and collect the Just results.

    let f x = if x == "a" then Just "new a" else Nothing
    mapMaybe f (fromList [(5,"a"), (3,"b")]) == singleton 5 "new a"
    

  3. mapMaybe :: (a -> Maybe b) -> Word64Map a -> Word64Map b

    ghc GHC.Data.Word64Map.Strict.Internal

    Map values and collect the Just results.

    let f x = if x == "a" then Just "new a" else Nothing
    mapMaybe f (fromList [(5,"a"), (3,"b")]) == singleton 5 "new a"
    

  4. mapMaybe :: forall (m :: Type -> Type) a b r . Functor m => (a -> Maybe b) -> Pipe a b m r

    pipes Pipes.Prelude

    (mapMaybe f) yields Just results of f. Basic laws:

    mapMaybe (f >=> g) = mapMaybe f >-> mapMaybe g
    
    mapMaybe (pure @Maybe . f) = mapMaybe (Just . f) = map f
    
    mapMaybe (const Nothing) = drain
    
    As a result of the second law,
    mapMaybe return = mapMaybe Just = cat
    

  5. mapMaybe :: (a -> Maybe b) -> CharMap a -> CharMap b

    regex-tdfa Data.IntMap.CharMap2

    No documentation available.

  6. mapMaybe :: Enum key => (a -> Maybe b) -> EnumMap key a -> EnumMap key b

    regex-tdfa Data.IntMap.EnumMap2

    No documentation available.

  7. mapMaybe :: Ord key => key -> T (Map key elem) (Maybe elem)

    data-accessor Data.Accessor.Container

    Treats a finite map like an infinite map, where all undefined elements are Nothing and defined elements are Just.

  8. mapMaybe :: (a -> Maybe b) -> InputStream a -> IO (InputStream b)

    io-streams System.IO.Streams.Combinators

    A version of map that discards elements mapMaybe f s passes all output from s through the function f and discards elements for which f s evaluates to Nothing. Example:

    ghci> Streams.fromList [Just 1, None, Just 3] >>=
    Streams.mapMaybe id >>=
    Streams.toList
    [1,3]
    
    Since: 1.2.1.0

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

    strict Data.Strict.Maybe

    Analogous to mapMaybe in Data.Maybe.

  10. mapMaybe :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2

    rio RIO.HashMap

    Transform this map by applying a function to every value and retaining only some of them.

Page 3 of many | Previous | Next