Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
maybeFromByteString :: ByteString -> T Tmidi Sound.MIDI.Message No documentation available.
-
ghc-internal GHC.Internal.Data.Maybe 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
maybeNew :: (a -> IO (Ptr b)) -> Maybe a -> IO (Ptr b)ghc-internal GHC.Internal.Foreign.Marshal.Utils Allocate storage and marshal a storable value wrapped into a Maybe
maybePeek :: (Ptr a -> IO b) -> Ptr a -> IO (Maybe b)ghc-internal GHC.Internal.Foreign.Marshal.Utils Convert a peek combinator into a one returning Nothing if applied to a nullPtr
maybeWith :: (a -> (Ptr b -> IO c) -> IO c) -> Maybe a -> (Ptr b -> IO c) -> IO cghc-internal GHC.Internal.Foreign.Marshal.Utils Converts a withXXX combinator into one marshalling a value wrapped into a Maybe, using nullPtr to represent Nothing.
maybeLens :: b -> Lens' (Maybe b) bproto-lens Data.ProtoLens.Message A helper lens for accessing optional fields. This is used as part of code generation, and should generally not be needed explicitly. Note that maybeLens does not satisfy the lens laws, which expect that set l (view l x) == x. For example,
set (maybeLens 'a') (view (maybeLens 'a') Nothing) == Just 'a'
However, this is the behavior generally expected by users, and only matters if we're explicitly checking whether a field is set.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.