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.
mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k brio RIO.Map Map keys/values and collect the Just results.
let f k _ = if k < 5 then Just ("key : " ++ (show k)) else Nothing mapMaybeWithKey f (fromList [(5,"a"), (3,"b")]) == singleton 3 "key : 3"
mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]rio RIO.Prelude Applicative mapMaybe.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]rio RIO.Prelude Monadic mapMaybe.
mapMaybeT :: (m (Maybe a) -> n (Maybe b)) -> MaybeT m a -> MaybeT n berrors Control.Error Transform the computation inside a MaybeT.
mapMaybeT :: (a -> Maybe b) -> [[a]] -> [[b]]leancheck Test.LeanCheck.Tiers Like mapMaybe but for tiers.
-
quickcheck-classes-base Test.QuickCheck.Classes.Base.IsList No documentation available.
-
quickcheck-classes-base Test.QuickCheck.Classes.Base.IsList Property for the mapMaybe function, which keeps elements for which the predicate holds true.
-
dependent-map Data.Dependent.Map O(n). Map keys/values and collect the Just results.
mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]relude Relude.Monad.Maybe The monadic version of the mapMaybe function.
>>> :{ evenInHalf :: Int -> IO (Maybe Int) evenInHalf n | even n = pure $ Just $ n `div` 2 | otherwise = pure Nothing :}
>>> mapMaybeM evenInHalf [1..10] [1,2,3,4,5]
mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2insert-ordered-containers Data.HashMap.Strict.InsOrd No documentation available.