Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
maybeCharRef :: T -> Maybe Intxml-basic Text.XML.Basic.Character No documentation available.
maybeEntityRef :: T -> Maybe Stringxml-basic Text.XML.Basic.Character No documentation available.
maybeUnicode :: T -> Maybe Charxml-basic Text.XML.Basic.Character No documentation available.
maybeXMLEncoding :: (Tag name, Attribute name) => Name name -> T name string -> Maybe stringxml-basic Text.XML.Basic.Tag No documentation available.
maybeFullIPv6Addr :: Text -> Maybe IPv6AddrIPv6Addr Text.IPv6Addr Returns Just a pure and fully expanded IPv6Addr, or Nothing.
maybeFullIPv6Addr "::ffff:192.0.2.128" == Just (IPv6Addr "0000:0000:0000:0000:0000:ffff:c000:0280")
maybeIPv6Addr :: Text -> Maybe IPv6AddrIPv6Addr Text.IPv6Addr Returns Just the text representation of a canonized IPv6Addr in conformation with RFC 5952, or Nothing.
maybeIPv6Addr "0:0::FFFF:192.0.2.128" == Just (IPv6Addr "::ffff:192.0.2.128")
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.