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 :: (v1 -> Maybe v2) -> HashMap k v1 -> HashMap k v2

    unordered-containers Data.HashMap.Internal

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

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

    unordered-containers Data.HashMap.Internal.Strict

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

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

    unordered-containers Data.HashMap.Lazy

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

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

    unordered-containers Data.HashMap.Strict

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

  5. mapMaybe :: forall (m :: Type -> Type) a b . Monad m => (a -> Maybe b) -> ConduitT a b m ()

    conduit Data.Conduit.List

    Apply a transformation that may fail to all values in a stream, discarding the failures. Subject to fusion Since 0.5.1

  6. mapMaybe :: (MonadGen m, GenBase m ~ Identity) => (a -> Maybe b) -> m a -> m b

    hedgehog Hedgehog.Gen

    Generates a value which is the result of the given function returning a Just. The original generator's shrink tree will be retained, with values returning Nothing removed. Subsequent shrinks of those values will be retained. Compared to mapMaybeT, shrinking may be slower but will be optimal. It's possible that the function will never return Just, or will only do so a larger size than we're currently running at. To avoid looping forever, we limit the number of retries, and grow the size with each retry. If we retry too many times then the whole generator is discarded.

  7. mapMaybe :: (MonadGen m, GenBase m ~ Identity) => (a -> Maybe b) -> m a -> m b

    hedgehog Hedgehog.Internal.Gen

    Generates a value which is the result of the given function returning a Just. The original generator's shrink tree will be retained, with values returning Nothing removed. Subsequent shrinks of those values will be retained. Compared to mapMaybeT, shrinking may be slower but will be optimal. It's possible that the function will never return Just, or will only do so a larger size than we're currently running at. To avoid looping forever, we limit the number of retries, and grow the size with each retry. If we retry too many times then the whole generator is discarded.

  8. mapMaybe :: (a -> Maybe b) -> Tree a -> Maybe (Tree b)

    hedgehog Hedgehog.Internal.Tree

    No documentation available.

  9. mapMaybe :: forall (m :: Type -> Type) a b . Functor m => (a -> Maybe b) -> SourceT m a -> SourceT m b

    servant Servant.Types.SourceT

    Filter values.

    >>> toList $ mapMaybe (\x -> if odd x then Just x else Nothing) (source [0..10]) :: [Int]
    [1,3,5,7,9]
    
    >>> mapMaybe (\x -> if odd x then Just x else Nothing) (source [0..2]) :: SourceT Identity Int
    fromStepT (Effect (Identity (Skip (Yield 1 (Skip Stop)))))
    
    Illustrates why we need Skip.

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

    ghc GHC.Data.Word64Map.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"
    

Page 2 of many | Previous | Next