Hoogle Search
Within LTS Haskell 23.24 (ghc-9.8.4)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
withDefault :: ArrowList a => a b c -> c -> a b chxt Control.Arrow.ArrowList converts an arrow, that may fail, into an arrow that always succeeds example: withDefault none "abc" is equivalent to constA "abc"
withDefault :: OpenMode mode => BlockMode -> (T mode -> IO a) -> IO aalsa-seq Sound.ALSA.Sequencer No documentation available.
withDefault :: JiraPrinter a -> ajira-wiki-markup Text.Jira.Printer Run with default state.
withDefault :: Show a => a -> Parser a -> Parser aopt-env-conf OptEnvConf Give a parser a default value. This is morally equal to (| pure a) but will give you better documentation of the default value in many cases. This does nothing if the parser already has a default value.
withDefault :: Show a => a -> Parser a -> Parser aopt-env-conf OptEnvConf.Parser Give a parser a default value. This is morally equal to (| pure a) but will give you better documentation of the default value in many cases. This does nothing if the parser already has a default value.
withDefault :: Validator e inp a -> a -> Validator e (Maybe inp) avalida Valida.Combinators Build a validator that runs given validator only if input is Just. Yields default value otherwise. Yields Success when input is Nothing, and wrapped around the default value.
vald `withDefault` deflt = fromMaybe deflt <$> optionally vald
Examples
>>> runValidator (failureIf even "Even" `withDefault` 0) (Just 5) Success 5 >>> runValidator (failureIf even "Even" `withDefault` 0) (Just 6) Failure ("Even" :| []) >>> runValidator (failureIf even "Even" `withDefault` 0) Nothing Success 0
-
Potentially uninitialised Booleans. The motivation for this small library is to distinguish between a boolean option with a default value and an option which has been set to what happens to be the default value. In one case the default can be overriden (e.g. --cubical implies --without-K) while in the other case the user has made a mistake which they need to fix.
type
WithDefault (b :: Bool) = WithDefault' Bool bAgda Agda.Utils.WithDefault No documentation available.
withDefaultBaseURI :: String -> SysConfighxt Text.XML.HXT.Arrow.XmlState withDefaultBaseURI URI , input option, set the default base URI This option can be useful when parsing documents from stdin or contained in a string, and interpreting relative URIs within the document
withDefaultBaseURI :: String -> SysConfighxt Text.XML.HXT.Arrow.XmlState.SystemConfig withDefaultBaseURI URI , input option, set the default base URI This option can be useful when parsing documents from stdin or contained in a string, and interpreting relative URIs within the document
Page 1 of many | Next