Hoogle Search
Within LTS Haskell 24.51 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
maybePureIPv6Addr :: Text -> Maybe IPv6AddrIPv6Addr Text.IPv6Addr Returns Just a pure IPv6Addr, or Nothing.
maybePureIPv6Addr "::ffff:192.0.2.128" == Just (IPv6Addr "::ffff:c000:280")
maybeF :: (a -> b -> a) -> a -> Maybe b -> Maybe aalgebraic-graphs Algebra.Graph.Internal An auxiliary function that tries to apply a function to a base case and a Maybe value and returns Just the result or Just the base case.
-
cabal-install-solver Distribution.Solver.Compat.Prelude The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.
Examples
Basic usage:>>> maybeToList (Just 7) [7]
>>> maybeToList Nothing []
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> sum $ maybeToList (readMaybe "3") 3 >>> sum $ maybeToList (readMaybe "") 0
maybeRead :: Read a => String -> Maybe acgi Network.CGI.Protocol No documentation available.
maybeBuildTopEntity :: Maybe String -> Name -> Q (TExp (Maybe TopEntity))clash-prelude Clash.Annotations.TH Return a typed 'Maybe TopEntity' expression given a Name. This will return an TExp of Nothing if TopEntity generation failed.
maybeHasX :: (NFData a, NFDataX a) => a -> Maybe aclash-prelude Clash.XException Fully evaluate a value, returning Nothing if it throws XException. Note that non-XException errors take precedence over XException ones.
maybeHasX 42 = Just 42 maybeHasX (XException msg) = Nothing maybeHasX (3, XException msg) = Nothing maybeHasX (XException msg, _|_) = _|_ maybeHasX (_|_, XException msg) = _|_ maybeHasX (3, _|_) = _|_ maybeHasX _|_ = _|_
-
clash-prelude Clash.XException Evaluate a value to WHNF, returning Nothing if it throws XException.
maybeIsX 42 = Just 42 maybeIsX (XException msg) = Nothing maybeIsX (3, XException msg) = Just (3, XException msg) maybeIsX (3, _|_) = Just (3, _|_) maybeIsX _|_ = _|_
maybeX :: (String -> b) -> (a -> b) -> MaybeX a -> bclash-prelude Clash.XException.MaybeX Map functions over both constructors.
-
classy-prelude-conduit ClassyPrelude.Conduit Wrap the base monad in MaybeT Since 1.0.11
maybeRecount :: (Countable a, Countable b) => a -> Maybe bcountable Data.Countable No documentation available.