class (c SpecVersion, c TestedWith, c SpecLicense, c Token, c Token', c FilePathNT) => FieldGrammar (c :: Type -> Constraint) (g :: Type -> Type -> Type) | g -> c whereFieldGrammar is parametrised by
swhich is a structure we are parsing. We need this to provide prettyprinter functionalityatype of the field.
Note: We'd like to have forall s. Applicative (f s) context.
Methods
blurFieldGrammar :: ALens' a b -> g b d -> g a dUnfocus, zoom out, blur FieldGrammar.
uniqueFieldAla :: (c b, Newtype a b) => FieldName -> (a -> b) -> ALens' s a -> g s aField which should be defined, exactly once.
booleanFieldDef :: FieldName -> ALens' s Bool -> Bool -> g s BoolBoolean field with a default value.
optionalFieldAla :: (c b, Newtype a b) => FieldName -> (a -> b) -> ALens' s (Maybe a) -> g s (Maybe a)Optional field.
optionalFieldDefAla :: (c b, Newtype a b, Eq a) => FieldName -> (a -> b) -> ALens' s a -> a -> g s aOptional field with default value.
freeTextField :: FieldName -> ALens' s (Maybe String) -> g s (Maybe String)freeTextFieldDef :: FieldName -> ALens' s String -> g s StringfreeTextFieldDefST :: FieldName -> ALens' s ShortText -> g s ShortTextmonoidalFieldAla :: (c b, Monoid a, Newtype a b) => FieldName -> (a -> b) -> ALens' s a -> g s aMonoidal field.
Values are combined with mappend.
Note: optionalFieldAla is a
monoidalFieldwithLastmonoid.prefixedFields :: FieldName -> ALens' s [(String, String)] -> g s [(String, String)]Parser matching all fields with a name starting with a prefix.
knownField :: FieldName -> g s ()Known field, which we don't parse, nor pretty print.
deprecatedSince :: CabalSpecVersion -> String -> g s a -> g s aDeprecated since
removedIn :: CabalSpecVersion -> String -> g s a -> g s aRemoved in. If we encounter removed field, parsing fails.
availableSince :: CabalSpecVersion -> a -> g s a -> g s aAnnotate field with since spec-version.
availableSinceWarn :: CabalSpecVersion -> g s a -> g s aAnnotate field with since spec-version. This is used to recognise, but warn about the field. It is used to process
other-extensionsfield.Default implementation is to not warn.
Instances3FieldGrammar
FieldGrammar ParsecPretty FieldDescrsDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.FieldDescrsNote: default values are printed.
FieldGrammar Parsec ParsecFieldGrammarDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecFieldGrammar Pretty PrettyFieldGrammarDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Pretty