Hoogle Search

Within LTS Haskell 24.38 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. mapMaybe :: (a -> Maybe b) -> NEIntMap a -> IntMap b

    nonempty-containers Data.IntMap.NonEmpty

    O(n). Map values and collect the Just results. Returns a potentially empty map (IntMap), because the function could potentially return Nothing on all items in the NEIntMap.

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

  2. mapMaybeWithKey :: (Key -> a -> Maybe b) -> NEIntMap a -> IntMap b

    nonempty-containers Data.IntMap.NonEmpty

    O(n). Map keys/values and collect the Just results. Returns a potentially empty map (IntMap), because the function could potentially return Nothing on all items in the NEIntMap.

    let f k _ = if k < 5 then Just ("key : " ++ (show k)) else Nothing
    mapMaybeWithKey f (fromList ((5,"a") :| [(3,"b")])) == Data.IntMap.singleton 3 "key : 3"
    

  3. mapMaybe :: (a -> Maybe b) -> NEMap k a -> Map k b

    nonempty-containers Data.Map.NonEmpty

    O(n). Map values and collect the Just results. Returns a potentially empty map (Map), because the function could potentially return Nothing on all items in the NEMap.

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

  4. mapMaybeWithKey :: (k -> a -> Maybe b) -> NEMap k a -> Map k b

    nonempty-containers Data.Map.NonEmpty

    O(n). Map keys/values and collect the Just results. Returns a potentially empty map (Map), because the function could potentially return Nothing on all items in the NEMap.

    let f k _ = if k < 5 then Just ("key : " ++ (show k)) else Nothing
    mapMaybeWithKey f (fromList ((5,"a") :| [(3,"b")])) == Data.Map.singleton 3 "key : 3"
    

  5. traverseMaybeWithKey :: Applicative t => (k -> a -> t (Maybe b)) -> NEMap k a -> t (Map k b)

    nonempty-containers Data.Map.NonEmpty

    O(n). Traverse keys/values and collect the Just results. Returns a potentially empty map (Map), our function might return Nothing on every item in the NEMap. Use traverseMaybeWithKey1 whenever possible (if your Applicative also has Apply instance). This version is provided only for types that do not have Apply instance, since Apply is not at the moment (and might not ever be) an official superclass of Applicative.

  6. traverseMaybeWithKey1 :: Apply t => (k -> a -> t (Maybe b)) -> NEMap k a -> t (Map k b)

    nonempty-containers Data.Map.NonEmpty

    O(n). Traverse keys/values and collect the Just results. Returns a potentially empty map (Map), our function might return Nothing on every item in the NEMap. Is more general than traverseWithKey, since works with all Apply, and not just Applicative.

  7. newtype ComposeMaybe (f :: k -> Type) (a :: k)

    patch Data.Functor.Misc

    We can't use Compose Maybe instead of ComposeMaybe, because that would make the f parameter have a nominal type role. We need f to be representational so that we can use safe coerce.

  8. ComposeMaybe :: Maybe (f a) -> ComposeMaybe (f :: k -> Type) (a :: k)

    patch Data.Functor.Misc

    No documentation available.

  9. getComposeMaybe :: ComposeMaybe (f :: k -> Type) (a :: k) -> Maybe (f a)

    patch Data.Functor.Misc

    No documentation available.

  10. catMaybes :: Vector (Maybe a) -> Vector a

    rebase Rebase.Data.Vector

    No documentation available.

Page 222 of many | Previous | Next