module Shrun.Configuration.Data.ConfigPhase
(
ConfigPhase (..),
ConfigPhaseF,
ConfigPhaseMaybeF,
LineTruncF,
SwitchF,
)
where
import Shrun.Configuration.Data.Truncation
( LineTruncation,
TruncRegion (TruncLine),
Truncation,
)
import Shrun.Configuration.Data.WithDisabled (WithDisabled)
import Shrun.Prelude
data ConfigPhase
=
ConfigPhaseArgs
|
ConfigPhaseToml
|
ConfigPhaseMerged
|
ConfigPhaseEnv
type ConfigPhaseF :: ConfigPhase -> Type -> Type
type family ConfigPhaseF p a where
ConfigPhaseF ConfigPhaseArgs a = WithDisabled a
ConfigPhaseF ConfigPhaseToml a = Maybe a
ConfigPhaseF ConfigPhaseMerged a = a
ConfigPhaseF ConfigPhaseEnv a = a
type ConfigPhaseMaybeF :: ConfigPhase -> Type -> Type
type family ConfigPhaseMaybeF p a where
ConfigPhaseMaybeF ConfigPhaseArgs a = WithDisabled a
ConfigPhaseMaybeF ConfigPhaseToml a = Maybe a
ConfigPhaseMaybeF ConfigPhaseMerged a = Maybe a
ConfigPhaseMaybeF ConfigPhaseEnv a = Maybe a
type SwitchF :: ConfigPhase -> Type -> Type
type family SwitchF p t where
SwitchF ConfigPhaseArgs _ = WithDisabled ()
SwitchF ConfigPhaseToml _ = Maybe Bool
SwitchF ConfigPhaseMerged t = t
SwitchF ConfigPhaseEnv t = t
type LineTruncF :: ConfigPhase -> Type
type family LineTruncF p where
LineTruncF ConfigPhaseArgs = WithDisabled LineTruncation
LineTruncF ConfigPhaseToml = Maybe LineTruncation
LineTruncF ConfigPhaseMerged = Maybe (Truncation TruncLine)
LineTruncF ConfigPhaseEnv = Maybe (Truncation TruncLine)