shrun
Safe HaskellNone
LanguageGHC2021

Shrun.Configuration.Data.WithDisabled

Synopsis

Documentation

data WithDisabled a Source #

WithDisabled augments some type with a disabled option. Isomorphic to Maybe, it exists to distinguish "missing" vs. explicitly disabled. For instance, we want to be able to disable the parameter notify-action, but we do not want to add another constructor to it, because we want NotifyActionComplete to represent definite actions, hence the user config (CLI and Toml) is 'Maybe (Disabled NotifyActionComplete)' i.e.

  • Just Disabled: NotifyActionComplete explicitly disabled.
  • Nothing: NotifyActionComplete not given.
  • Just Enabled _: NotifyActionComplete explicity enabled.

We have this for the purposes of allowing CLI the override whatever Toml parameter might exist, while at shrun's runtime it is merged to 'Maybe NotifyActionComplete':

  • Nothing: Notifications off.
  • Just NotifyActionComplete: Notifications on.

Constructors

With a

The field.

Disabled

Disabled.

Instances

Instances details
Alternative WithDisabled Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

Applicative WithDisabled Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

Functor WithDisabled Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

Methods

fmap :: (a -> b) -> WithDisabled a -> WithDisabled b #

(<$) :: a -> WithDisabled b -> WithDisabled a #

Show a => Show (WithDisabled a) Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

Eq a => Eq (WithDisabled a) Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

Pretty a => Pretty (WithDisabled a) Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

Methods

pretty :: WithDisabled a -> Doc ann Source #

prettyList :: [WithDisabled a] -> Doc ann Source #

Default (WithDisabled Timeout) Source # 
Instance details

Defined in Shrun.Configuration.Data.Core.Timeout

DecodeTOML a => DecodeTOML (WithDisabled a) Source # 
Instance details

Defined in Shrun.Configuration.Data.WithDisabled

(<|?|>) :: Maybe (WithDisabled a) -> Maybe (WithDisabled a) -> Maybe a infixr 6 Source #

Runs Maybes Alternative instance, then binds with toMaybe. I.e., takes any Just if it exists (left-biased), then performs monadic join.