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. mapMaybeWithKey :: (k -> a -> Maybe b) -> Map k a -> Map k b

    rio 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"
    

  2. mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> [a] -> f [b]

    rio RIO.Prelude

    Applicative mapMaybe.

  3. mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b]

    rio RIO.Prelude

    Monadic mapMaybe.

  4. mapMaybeT :: (m (Maybe a) -> n (Maybe b)) -> MaybeT m a -> MaybeT n b

    errors Control.Error

    Transform the computation inside a MaybeT.

  5. mapMaybeT :: (a -> Maybe b) -> [[a]] -> [[b]]

    leancheck Test.LeanCheck.Tiers

    Like mapMaybe but for tiers.

  6. mapMaybeMProp :: (IsList c, IsList d, Eq d, Show d, Show b, Item c ~ a, Item d ~ b, Arbitrary c, Arbitrary b, Show c, Show a, CoArbitrary a, Function a) => Proxy a -> Proxy b -> (forall s . () => (a -> ST s (Maybe b)) -> c -> ST s d) -> Property

    quickcheck-classes-base Test.QuickCheck.Classes.Base.IsList

    No documentation available.

  7. mapMaybeProp :: (IsList c, Item c ~ a, Item d ~ b, Eq d, IsList d, Arbitrary b, Show d, Show b, Arbitrary c, Show c, Show a, Eq c, CoArbitrary a, Function a) => Proxy a -> Proxy b -> ((a -> Maybe b) -> c -> d) -> Property

    quickcheck-classes-base Test.QuickCheck.Classes.Base.IsList

    Property for the mapMaybe function, which keeps elements for which the predicate holds true.

  8. mapMaybeWithKey :: GCompare k2 => (forall (v :: k1) . () => k2 v -> f v -> Maybe (g v)) -> DMap k2 f -> DMap k2 g

    dependent-map Data.Dependent.Map

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

  9. 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]
    

  10. mapMaybeWithKey :: (k -> v1 -> Maybe v2) -> InsOrdHashMap k v1 -> InsOrdHashMap k v2

    insert-ordered-containers Data.HashMap.Strict.InsOrd

    No documentation available.

Page 19 of many | Previous | Next