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. arithMaybeD :: forall r (s :: Nat) p . Arith (Decimal r s p) -> Maybe (Decimal r s p)

    safe-decimal Numeric.Decimal

    A version of arithD that converts to Maybe

    >>> import Numeric.Decimal
    
    >>> :set -XTypeApplications
    
    >>> arithMaybeD @RoundDown @3 @Word (1.1 + 123)
    Just 124.100
    
    >>> arithMaybeD @RoundDown @3 @Word (1.1 - 123)
    Nothing
    

  2. arithMaybe :: Arith a -> Maybe a

    safe-decimal Numeric.Decimal.BoundedArithmetic

    A version of arithM restricted to Maybe

  3. parseMaybe :: (a -> Parser b) -> a -> Maybe b

    safe-json Data.Aeson.Safe

    Run a Parser with a Maybe result type.

  4. elmListOfMaybes :: [Doc] -> Doc

    servant-elm Servant.Elm.Internal.Generate

    No documentation available.

  5. isElmListOfMaybeBoolType :: EType -> Bool

    servant-elm Servant.Elm.Internal.Generate

    No documentation available.

  6. isElmMaybeStringType :: ElmOptions -> EType -> Bool

    servant-elm Servant.Elm.Internal.Generate

    Determines whether a type is 'Maybe a' where a is something akin to a String.

  7. isElmMaybeType :: EType -> Bool

    servant-elm Servant.Elm.Internal.Generate

    No documentation available.

  8. parseMaybe :: (Ord e, Stream s) => Parsec e s a -> s -> Maybe a

    shellwords Text.Megaparsec.Compat

    parseMaybe p input runs the parser p on input and returns the result inside Just on success and Nothing on failure. This function also parses eof, so if the parser doesn't consume all of its input, it will fail. The function is supposed to be useful for lightweight parsing, where error messages (and thus file names) are not important and entire input should be consumed. For example, it can be used for parsing of a single number according to a specification of its format.

  9. catMaybes :: Slist (Maybe a) -> Slist a

    slist Slist

    Takes a slist of Maybes and returns a slist of all the Just values.

    >>> catMaybes (cons (Just 1) $ cons Nothing $ one $ Just 3)
    Slist {sList = [1,3], sSize = Size 2}
    

  10. mapMaybe :: forall b a . (a -> Maybe b) -> Slist a -> Slist b

    slist Slist

    The Maybe version of map which can throw out elements. If appliying the given function returns Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.

    >>> maybeEven x = if even x then Just x else Nothing
    
    >>> s = cons 1 $ cons 2 $ one 3
    
    >>> mapMaybe maybeEven s
    Slist {sList = [2], sSize = Size 1}
    
    If we map the Just constructor, the entire list should be returned:
    >>> mapMaybe Just s
    Slist {sList = [1,2,3], sSize = Size 3}
    

Page 285 of many | Previous | Next