Hoogle Search
Within LTS Haskell 24.46 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
class
ReifyMaybeSymbol (mstr :: Maybe Symbol)bytezap Bytezap.Parser.Struct.Generic No documentation available.
reifyMaybeSymbol :: ReifyMaybeSymbol mstr => Maybe Stringbytezap Bytezap.Parser.Struct.Generic No documentation available.
-
classy-prelude-yesod ClassyPrelude.Yesod No documentation available.
-
classy-prelude-yesod ClassyPrelude.Yesod The Maybe keyword goes after the type. This indicates that the column is nullable, and the generated Haskell code will have a Maybe type for it. Example:
User name Text Maybe
-
classy-prelude-yesod ClassyPrelude.Yesod No documentation available.
-
classy-prelude-yesod ClassyPrelude.Yesod Takes all of the Just values from a sequence of Maybe ts and concatenates them into an unboxed sequence of ts. Since 0.6.2
fromMaybe :: a -> Maybe a -> aclassy-prelude-yesod ClassyPrelude.Yesod The fromMaybe function takes a default value and a Maybe value. If the Maybe is Nothing, it returns the default value; otherwise, it returns the value contained in the Maybe.
Examples
Basic usage:>>> fromMaybe "" (Just "Hello, World!") "Hello, World!"
>>> fromMaybe "" Nothing ""
Read an integer from a string using readMaybe. If we fail to parse an integer, we want to return 0 by default:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> fromMaybe 0 (readMaybe "5") 5 >>> fromMaybe 0 (readMaybe "") 0
-
classy-prelude-yesod ClassyPrelude.Yesod Like fuseBoth, but does not force consumption of the Producer. In the case that the Producer terminates, the result value is provided as a Just value. If it does not terminate, then a Nothing value is returned. One thing to note here is that "termination" here only occurs if the Producer actually yields a Nothing value. For example, with the Producer mapM_ yield [1..5], if five values are requested, the Producer has not yet terminated. Termination only occurs when the sixth value is awaited for and the Producer signals termination. Since 1.2.4
isFieldMaybe :: FieldDef -> Boolclassy-prelude-yesod ClassyPrelude.Yesod Check if the field is `Maybe a`
-
classy-prelude-yesod ClassyPrelude.Yesod The listToMaybe function returns Nothing on an empty list or Just a where a is the first element of the list.
Examples
Basic usage:>>> listToMaybe [] Nothing
>>> listToMaybe [9] Just 9
>>> listToMaybe [1,2,3] Just 1
Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:>>> maybeToList $ listToMaybe [5] [5] >>> maybeToList $ listToMaybe [] []
But not on lists with more than one element:>>> maybeToList $ listToMaybe [1,2,3] [1]