Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class RecFromCLI a where
- type FieldFromCLI a = FieldFromCLI_ (MarkerOf (Snd a)) a
- type RecordUsableWithCLI rs = (RecFromCLI (Rec (Tagged SourceTag `Compose` DocField) rs), ToJSONFields rs, FromJSON (Rec PossiblyEmptyField rs), RMap rs, RApply rs)
- data SourceTag
- type SourcedDocField = Tagged SourceTag `Compose` DocField
- rmTags :: RMap r => Rec SourcedDocField r -> Rec DocField r
- tagWithDefaultSource :: RMap rs => Rec DocField rs -> Rec SourcedDocField rs
- tagWithYamlSource :: RMap rs => Rec DocField rs -> Rec SourcedDocField rs
- parseRecFromCLI :: forall (rs :: [PathWithType [Symbol] *]) f. RecFromCLI (Rec f rs) => Rec f rs -> Parser (Rec f rs)
Documentation
class RecFromCLI a where Source #
Instances
(NamedField f, FieldWithTag Text f, FieldWithTag SourceTag f, FieldFromCLI (s :|: t), RecFromCLI (Rec f rs), ShowPath s) => RecFromCLI (Rec f ((s :|: t) ': rs)) Source # | |
RecFromCLI (Rec f ([] :: [PathWithType [Symbol] Type])) Source # | |
type FieldFromCLI a = FieldFromCLI_ (MarkerOf (Snd a)) a Source #
type RecordUsableWithCLI rs = (RecFromCLI (Rec (Tagged SourceTag `Compose` DocField) rs), ToJSONFields rs, FromJSON (Rec PossiblyEmptyField rs), RMap rs, RApply rs) Source #
Is satisfied when every field of a DocRec
rs
is transformable from & to
JSON and gettable from the CLI.
Identifies the source of a value in the configuration, so that we can be sure to override the right values with the right values.
The Ord instance makes it so CLI overrides YAML and YAML overrides Default.
Instances
Eq SourceTag Source # | |
Ord SourceTag Source # | |
Defined in Data.DocRecord.OptParse | |
Show SourceTag Source # | |
Semigroup SourceTag Source # | |
Monoid SourceTag Source # | |
NamedFieldTag SourceTag Source # | |
Defined in Data.DocRecord.OptParse defaultTag :: SourceTag Source # tagFromDoc :: Text -> SourceTag Source # |
type SourcedDocField = Tagged SourceTag `Compose` DocField Source #
A DocField with a Source tag attached
tagWithDefaultSource :: RMap rs => Rec DocField rs -> Rec SourcedDocField rs Source #
tagWithYamlSource :: RMap rs => Rec DocField rs -> Rec SourcedDocField rs Source #
parseRecFromCLI :: forall (rs :: [PathWithType [Symbol] *]) f. RecFromCLI (Rec f rs) => Rec f rs -> Parser (Rec f rs) Source #