Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Default and active values for options They can be defined and / or overridden separately from the option definition themselves
Synopsis
- newtype DefaultValue (s :: Symbol) a = DefaultValue (Maybe Dynamic)
- newtype ActiveValue (s :: Symbol) a = ActiveValue (Maybe Dynamic)
- getDefaultValue :: forall (a :: Type) s. (Typeable a, KnownSymbol s) => DefaultValue s a -> Maybe a
- getActiveValue :: forall (a :: Type) s. (Typeable a, KnownSymbol s) => ActiveValue s a -> Maybe a
- noDefaultValue :: forall s (a :: Type). (KnownSymbol s, Typeable a) => Typed (DefaultValue s a)
- noActiveValue :: forall s (a :: Type). (KnownSymbol s, Typeable a) => Typed (ActiveValue s a)
- createDefaultValue :: forall s (a :: Type). (Typeable a, KnownSymbol s) => a -> DefaultValue s a
- createActiveValue :: forall s (a :: Type). (Typeable a, KnownSymbol s) => a -> ActiveValue s a
Documentation
newtype DefaultValue (s :: Symbol) a Source #
Contain an optional value to return when an option is missing
newtype ActiveValue (s :: Symbol) a Source #
Contain an optional value to return when an option is present
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