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. iterateMaybe :: forall o i u (m :: Type -> Type) . (o -> Maybe o) -> o -> Pipe i o u m ()

    conduino Data.Conduino.Combinators

    A version of iterate that can choose to terminate and stop by returning Nothing.

  2. repeatMaybeM :: Monad m => m (Maybe o) -> Pipe i o u m ()

    conduino Data.Conduino.Combinators

    Repeat a monadic action, yielding the item in the Just every time. As soon as it sees Nothing, stop producing forever. Remember that each item will only be "executed" when something downstream requests output.

  3. unfoldMaybe :: forall s o i u (m :: Type -> Type) . (s -> Maybe (o, s)) -> s -> Pipe i o u m ()

    conduino Data.Conduino.Combinators

    A version of unfold that can terminate and end by returning Nothing.

  4. objectEntryMaybeParser :: (Char -> Parser a) -> Parser (Maybe (Text, Value))

    conduit-aeson Data.Conduit.Aeson

    Parse JSON key value pairs followed either by a delimiter or terminating character ']', which is also supplied to the delimiter parser. Nothing is returned when terminating character is reached.

  5. valueMaybeParser :: (Char -> Parser a) -> Parser (Maybe Value)

    conduit-aeson Data.Conduit.Aeson

    Parse a JSON value followed either by a delimiter or terminating character ']', which is also supplied to the delimiter parser. Nothing is returned when terminating character is reached.

  6. mapMaybeSerialized :: forall s t (m :: Type -> Type -> Type) (n :: Type -> Type) a . (Monoid s, Monoid t, InputParsing (m s), InputParsing (m t), s ~ ParserInput (m s), t ~ ParserInput (m t), InputMappableParsing m, Functor n) => (s -> Maybe t) -> (t -> Maybe s) -> Format (m s) n s a -> Format (m t) n t a

    construct Construct

    Converts a format for serialized streams of type s so it works for streams of type t instead. The argument functions may return Nothing to indicate they have insuficient input to perform the conversion.

  7. mapMaybeValue :: forall (m :: Type -> Type) a b (n :: Type -> Type) s . (Monad m, Parsing m, Show a, Show b, AlternativeFail n) => (a -> Maybe b) -> (b -> Maybe a) -> Format m n s a -> Format m n s b

    construct Construct

    Converts a format for in-memory values of type a so it works for values of type b instead. The argument functions may signal conversion failure by returning Nothing.

  8. mapMaybeParserInput :: (InputMappableParsing m, InputParsing (m s), s ~ ParserInput (m s), Monoid s, Monoid s') => (s -> Maybe s') -> (s' -> Maybe s) -> m s a -> m s' a

    construct Construct.Classes

    Converts a parser accepting one input stream type to another just like mapParserInput, except the argument functions can return Nothing to indicate they need more input.

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

    dependent-monoidal-map Data.Dependent.Map.Monoidal

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

  10. fromMaybe :: a -> Maybe a -> a

    distribution-opensuse OpenSuse.Prelude

    The fromMaybe function takes a default value and a Maybe value. If the Maybe is Nothing, it returns the default value; otherwise, it returns the value contained in the Maybe.

    Examples

    Basic usage:
    >>> fromMaybe "" (Just "Hello, World!")
    "Hello, World!"
    
    >>> fromMaybe "" Nothing
    ""
    
    Read an integer from a string using readMaybe. If we fail to parse an integer, we want to return 0 by default:
    >>> import GHC.Internal.Text.Read ( readMaybe )
    
    >>> fromMaybe 0 (readMaybe "5")
    5
    
    >>> fromMaybe 0 (readMaybe "")
    0
    

Page 266 of many | Previous | Next