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.
maybeToEnum :: MessageEnum a => Int -> Maybe aproto-lens Data.ProtoLens.Message Convert the given Int to an enum value. Returns Nothing if no corresponding value was defined in the .proto file.
-
protolude Protolude 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
maybeEmpty :: Monoid b => (a -> b) -> Maybe a -> bprotolude Protolude.Either No documentation available.
maybeToEither :: e -> Maybe a -> Either e aprotolude Protolude.Either No documentation available.
maybeToLeft :: r -> Maybe l -> Either l rprotolude Protolude.Either No documentation available.
maybeToRight :: l -> Maybe r -> Either l rprotolude Protolude.Either No documentation available.
maybeDCaseE :: MatchContext -> DExp -> [DMatch] -> DExpth-desugar Language.Haskell.TH.Desugar If matches is non-empty, make a case statement; otherwise make an error statement
maybeDLetE :: [DLetDec] -> DExp -> DExpth-desugar Language.Haskell.TH.Desugar If decs is non-empty, delcare them in a let:
maybeToAttr :: (String -> a -> Maybe Attribute) -> String -> Maybe a -> Maybe AttributeHaXml Text.XML.HaXml.XmlContent.Parser No documentation available.
maybeToEither :: MonadError e m => e -> Maybe a -> m aMissingH Data.Either.Utils Converts a Maybe value to an Either value, using the supplied parameter as the Left value if the Maybe is Nothing. This function can be interpreted as:
maybeToEither :: e -> Maybe a -> Either e a
Its definition is given as it is so that it can be used in the Error and related monads.