Hoogle Search

Within LTS Haskell 24.36 (ghc-9.10.3)

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

  1. runMaybeApply :: MaybeApply (f :: Type -> Type) a -> Either (f a) a

    semigroupoids Data.Functor.Bind.Class

    No documentation available.

  2. traverse1Maybe :: (Traversable t, Apply f) => (a -> f b) -> t a -> MaybeApply f (t b)

    semigroupoids Data.Functor.Bind.Class

    Traverse a Traversable using Apply, getting the results back in a MaybeApply.

  3. traverse1Maybe :: (Traversable t, Apply f) => (a -> f b) -> t a -> MaybeApply f (t b)

    semigroupoids Data.Semigroup.Traversable

    Traverse a Traversable using Apply, getting the results back in a MaybeApply.

  4. minusNaturalMaybe :: Natural -> Natural -> Maybe Natural

    base-compat Numeric.Natural.Compat

    Natural subtraction. Returns Nothings for non-positive results.

  5. readMaybe :: Read a => String -> Maybe a

    base-compat Text.Read.Compat

    Parse a string using the Read instance. Succeeds if there is exactly one valid result.

    >>> readMaybe "123" :: Maybe Int
    Just 123
    
    >>> readMaybe "hello" :: Maybe Int
    Nothing
    

  6. partitionMaybe :: (a -> Maybe b) -> [a] -> ([b], [a])

    utility-ht Data.List.HT

    Partition a list into elements which evaluate to Just or Nothing by f.

    forAllMaybeFn $ \f xs -> partitionMaybe f xs == (mapMaybe f xs, filter (isNothing . f) xs)
    
    forAllPredicates $ \p xs -> partition p xs == partitionMaybe (\x -> toMaybe (p x) x) xs
    

  7. segmentAfterMaybe :: (a -> Maybe b) -> [a] -> ([([a], b)], [a])

    utility-ht Data.List.HT

    Deprecated: use segmentAfterJust instead

  8. segmentBeforeMaybe :: (a -> Maybe b) -> [a] -> ([a], [(b, [a])])

    utility-ht Data.List.HT

    Deprecated: use segmentBeforeJust instead

  9. toMaybe :: Bool -> a -> Maybe a

    utility-ht Data.Maybe.HT

    Returns Just if the precondition is fulfilled. prop> b x -> (guard b >> x) == (toMaybe b =<< (x::Maybe Char))

  10. 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.

Page 114 of many | Previous | Next