registry-options-0.2.0.0: application options parsing
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Registry.Options.DefaultValues

Description

Default and active values for options They can be defined and / or overridden separately from the option definition themselves

Synopsis

Documentation

newtype DefaultValue (s :: Symbol) a Source #

Contain an optional value to return when an option is missing

Constructors

DefaultValue (Maybe Dynamic) 

newtype ActiveValue (s :: Symbol) a Source #

Contain an optional value to return when an option is present

Constructors

ActiveValue (Maybe Dynamic) 

getDefaultValue :: forall (a :: Type) s. (Typeable a, KnownSymbol s) => DefaultValue s a -> Maybe a Source #

Get the default value in DefaultValue if it exists and has the right type

getActiveValue :: forall (a :: Type) s. (Typeable a, KnownSymbol s) => ActiveValue s a -> Maybe a Source #

Get the active value in ActiveValue if it exists and has the right type

noDefaultValue :: forall s (a :: Type). (KnownSymbol s, Typeable a) => Typed (DefaultValue s a) Source #

Allow to specify that a given field name and type has no default value

noActiveValue :: forall s (a :: Type). (KnownSymbol s, Typeable a) => Typed (ActiveValue s a) Source #

Allow to specify that a given field name and type has no active value

createDefaultValue :: forall s (a :: Type). (Typeable a, KnownSymbol s) => a -> DefaultValue s a Source #

Add a default value for a given field name and type

createActiveValue :: forall s (a :: Type). (Typeable a, KnownSymbol s) => a -> ActiveValue s a Source #

Add a default value for a given field name and type