HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

ModuleCabal-syntax-3.12.1.0Haskell2010

Distribution.FieldGrammar.Newtypes

This module provides newtype wrappers to be used with Distribution.FieldGrammar.

  • 15 types
  • 1 class
  • 6 values

List

2 declarations
valuealaList :: sep -> [a] -> List sep (Identity a) a
#

alaList and alaList' are simply List, with additional phantom arguments to constrain the resulting type

Example1 expression
:t alaList VCatalaList VCat :: [a] -> List VCat (Identity a) a
Example1 expression
:t alaList' FSep TokenalaList' FSep Token :: [String] -> List FSep Token String

Modifiers

datadata CommaVCat
#

Vertical list with commas. Displayed with vcat

Instances1Sep
  • Sep CommaVCatDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
datadata CommaFSep
#

Paragraph fill list with commas. Displayed with fsep

Instances1Sep
  • Sep CommaFSepDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
datadata VCat
#

Vertical list with optional commas. Displayed with vcat.

Instances1Sep
  • Sep VCatDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
datadata FSep
#

Paragraph fill list with optional commas. Displayed with fsep.

Instances1Sep
  • Sep FSepDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
classclass Sep sep where
#

Methods

Instances5Sep
  • Sep CommaFSepDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Sep CommaVCatDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Sep FSepDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Sep NoCommaFSepDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Sep VCatDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes

Type

newtypenewtype List sep b a
#

List separated with optional commas. Displayed with sep, arguments of type a are parsed and pretty-printed as b.

Instances3Newtype, Parsec, Pretty
  • Newtype [a] (List sep wrapper a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • (Newtype a b, Sep sep, Parsec b) => Parsec (List sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • (Newtype a b, Sep sep, Pretty b) => Pretty (List sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes

Set

valuealaSet :: sep -> Set a -> Set' sep (Identity a) a
#

alaSet and alaSet' are simply Set' constructor, with additional phantom arguments to constrain the resulting type

Example1 expression
:t alaSet VCatalaSet VCat :: Set a -> Set' VCat (Identity a) a
Example1 expression
:t alaSet' FSep TokenalaSet' FSep Token :: Set String -> Set' FSep Token String
Example1 expression
unpack' (alaSet' FSep Token) <$> eitherParsec "foo bar foo"Right (fromList ["bar","foo"])
newtypenewtype Set' sep b a
#

Like List, but for Set.

Instances3Newtype, Parsec, Pretty
  • Newtype (Set a) (Set' sep wrapper a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • (Newtype a b, Ord a, Sep sep, Parsec b) => Parsec (Set' sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • (Newtype a b, Sep sep, Pretty b) => Pretty (Set' sep b a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes

NonEmpty

valuealaNonEmpty :: sep -> NonEmpty a -> NonEmpty' sep (Identity a) a
#

alaNonEmpty and alaNonEmpty' are simply NonEmpty' constructor, with additional phantom arguments to constrain the resulting type

Example1 expression
:t alaNonEmpty VCatalaNonEmpty VCat :: NonEmpty a -> NonEmpty' VCat (Identity a) a
Example1 expression
unpack' (alaNonEmpty' FSep Token) <$> eitherParsec "foo bar foo"Right ("foo" :| ["bar","foo"])

Version & License

3 declarations
newtypenewtype SpecVersion
#

Version range or just version, i.e. cabal-version field.

There are few things to consider:

We have this newtype, as writing Parsec and Pretty instances for CabalSpecVersion would cause cycle in modules: Version -> CabalSpecVersion -> Parsec -> ...

Instances5Eq, Show, Parsec, Pretty, Newtype
newtypenewtype SpecLicense
#

SPDX License expression or legacy license

Instances5Eq, Show, Parsec, Pretty, Newtype

Identifiers

4 declarations
newtypenewtype Token
#

Haskell string or [^ ,]+

Constructors

Instances3Parsec, Pretty, Newtype
  • Parsec TokenDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty TokenDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Newtype String TokenDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
newtypenewtype Token'
#

Haskell string or [^ ]+

Constructors

Instances3Parsec, Pretty, Newtype
  • Parsec Token'Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty Token'Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Newtype String Token'Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
newtypenewtype MQuoted a
#

Either "quoted" or un-quoted.

Constructors

Instances3Newtype, Parsec, Pretty
  • Newtype a (MQuoted a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Parsec a => Parsec (MQuoted a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes
  • Pretty a => Pretty (MQuoted a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypes