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.
mapMaybe :: (a -> Maybe b) -> Word64Map a -> Word64Map bghc 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"
mapMaybe :: (a -> Maybe b) -> Word64Map a -> Word64Map bghc 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"
mapMaybe :: (a -> Maybe b) -> Word64Map a -> Word64Map bghc 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"
mapMaybe :: forall (m :: Type -> Type) a b r . Functor m => (a -> Maybe b) -> Pipe a b m rpipes 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
mapMaybe :: (a -> Maybe b) -> CharMap a -> CharMap bregex-tdfa Data.IntMap.CharMap2 No documentation available.
mapMaybe :: Enum key => (a -> Maybe b) -> EnumMap key a -> EnumMap key bregex-tdfa Data.IntMap.EnumMap2 No documentation available.
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.
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.0mapMaybe :: (a -> Maybe b) -> [a] -> [b]strict Data.Strict.Maybe Analogous to mapMaybe in Data.Maybe.
mapMaybe :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2rio RIO.HashMap Transform this map by applying a function to every value and retaining only some of them.