HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

ModuleCabal-syntax-3.18.1.0Haskell2010

Distribution.FieldGrammar

This module provides a way to specify a grammar of .cabal -like files.

Contents
  1. Field grammar type
  2. Concrete grammar implementations
  3. Auxiliary
  4. Newtypes
Synopsis

Field grammar type

classclass (c SpecVersion, c TestedWith, c SpecLicense, c Token, c Token', c FilePathNT, forall s. Applicative (g s)) => FieldGrammar (c :: Type -> Constraint) (g :: Type -> Type -> Type) | g -> c where

g is parametrised by

  • s which is a structure we are parsing. We need this to provide prettyprinter functionality

  • a type of the field.

Methods

Instances3FieldGrammar

Concrete grammar implementations

Auxiliary

value(^^^) :: a -> (a -> b) -> b

Reverse function application which binds tighter than <$> and <*>. Useful for refining grammar specification.

<*> monoidalFieldAla "extensions"           (alaList' FSep MQuoted)       oldExtensions
    ^^^ deprecatedSince [1,12] "Please use 'default-extensions' or 'other-extensions' fields."
valuepartitionFields :: [Field ann] -> (Fields ann, [[Section ann]])

Partition field list into field map and groups of sections. Groups sections between fields. This means that the following snippet contains two section groups:

-- first group
some-section
    field: value
another-section
    field: value
foo: bar
-- second group
yet-another-section
    field: value

Newtypes