| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Shrun.Configuration.Data.ConfigPhase
Contents
Description
Higher-Kinded data with type families for "phased-data" approach.
Synopsis
- data ConfigPhase
- type family ConfigPhaseF (p :: ConfigPhase) a where ...
- type family ConfigPhaseMaybeF (p :: ConfigPhase) a where ...
- type family ConfigPhaseDisabledMaybeF (p :: ConfigPhase) a where ...
- type family LineTruncF (p :: ConfigPhase) where ...
- type family SwitchF (p :: ConfigPhase) t where ...
- parseSwitch :: MonadFail m => Text -> m Bool
Types
data ConfigPhase Source #
Data "phases" related to configuration.
Constructors
| ConfigPhaseArgs | Args phase. |
| ConfigPhaseToml | Toml phase. |
| ConfigPhaseMerged | Merged args + toml phase. |
| ConfigPhaseEnv | Env created from MergedConfig |
Type families
type family ConfigPhaseF (p :: ConfigPhase) a where ... Source #
General type family representing:
- Args: Maybe w/ disable flag
- Toml: Maybe
- Merged: Definite
Equations
| ConfigPhaseF 'ConfigPhaseArgs a = Maybe a | |
| ConfigPhaseF 'ConfigPhaseToml a = Maybe a | |
| ConfigPhaseF 'ConfigPhaseMerged a = a | |
| ConfigPhaseF 'ConfigPhaseEnv a = a |
type family ConfigPhaseMaybeF (p :: ConfigPhase) a where ... Source #
General type family representing:
- Args: Maybe w/ disable flag
- Toml: Maybe
- Merged: Maybe
Equations
| ConfigPhaseMaybeF 'ConfigPhaseArgs a = Maybe a | |
| ConfigPhaseMaybeF 'ConfigPhaseToml a = Maybe a | |
| ConfigPhaseMaybeF 'ConfigPhaseMerged a = Maybe a | |
| ConfigPhaseMaybeF 'ConfigPhaseEnv a = Maybe a |
type family ConfigPhaseDisabledMaybeF (p :: ConfigPhase) a where ... Source #
Equations
type family LineTruncF (p :: ConfigPhase) where ... Source #
Line truncation is truly optional, the default being none.
type family SwitchF (p :: ConfigPhase) t where ... Source #
General type family representing a boolean switch for a type t that
is isomorphic to Bool. Args and Toml distinguish explicit false
(Just false) vs. not given (Nothing).
- Args: Maybe t
- Toml: Maybe t
- Merged: t
- Env: t
Equations
| SwitchF 'ConfigPhaseArgs t = Maybe t | |
| SwitchF 'ConfigPhaseToml t = Maybe t | |
| SwitchF 'ConfigPhaseMerged t = t | |
| SwitchF 'ConfigPhaseEnv t = t |