Cabal-3.0.0.0: A framework for packaging Haskell software

Safe HaskellNone
LanguageHaskell2010

Distribution.Parsec.Newtypes

Contents

Description

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

Synopsis

List

alaList :: sep -> [a] -> List sep (Identity a) a #

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

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

alaList' :: sep -> (a -> b) -> [a] -> List sep b a #

More general version of alaList.

Modifiers

data CommaVCat #

Vertical list with commas. Displayed with vcat

Constructors

CommaVCat 
Instances
Sep CommaVCat # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P CommaVCat -> [Doc] -> Doc #

parseSep :: CabalParsing m => P CommaVCat -> m a -> m [a] #

data CommaFSep #

Paragraph fill list with commas. Displayed with fsep

Constructors

CommaFSep 
Instances
Sep CommaFSep # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P CommaFSep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P CommaFSep -> m a -> m [a] #

data VCat #

Vertical list with optional commas. Displayed with vcat.

Constructors

VCat 
Instances
Sep VCat # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P VCat -> [Doc] -> Doc #

parseSep :: CabalParsing m => P VCat -> m a -> m [a] #

data FSep #

Paragraph fill list with optional commas. Displayed with fsep.

Constructors

FSep 
Instances
Sep FSep # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P FSep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P FSep -> m a -> m [a] #

data NoCommaFSep #

Paragraph fill list without commas. Displayed with fsep.

Constructors

NoCommaFSep 
Instances
Sep NoCommaFSep # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P NoCommaFSep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P NoCommaFSep -> m a -> m [a] #

class Sep sep where #

Methods

prettySep :: P sep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P sep -> m a -> m [a] #

Instances
Sep NoCommaFSep # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P NoCommaFSep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P NoCommaFSep -> m a -> m [a] #

Sep FSep # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P FSep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P FSep -> m a -> m [a] #

Sep VCat # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P VCat -> [Doc] -> Doc #

parseSep :: CabalParsing m => P VCat -> m a -> m [a] #

Sep CommaFSep # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P CommaFSep -> [Doc] -> Doc #

parseSep :: CabalParsing m => P CommaFSep -> m a -> m [a] #

Sep CommaVCat # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

prettySep :: P CommaVCat -> [Doc] -> Doc #

parseSep :: CabalParsing m => P CommaVCat -> m a -> m [a] #

Type

data List sep b a #

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

Instances
Newtype [a] (List sep wrapper a) # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

pack :: [a] -> List sep wrapper a #

unpack :: List sep wrapper a -> [a] #

(Newtype a b, Sep sep, Pretty b) => Pretty (List sep b a) # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

pretty :: List sep b a -> Doc #

prettyVersioned :: CabalSpecVersion -> List sep b a -> Doc #

(Newtype a b, Sep sep, Parsec b) => Parsec (List sep b a) # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

parsec :: CabalParsing m => m (List sep b a) #

Version & License

newtype SpecVersion #

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

There are few things to consider:

newtype SpecLicense #

SPDX License expression or legacy license

Identifiers

newtype Token #

Haskell string or [^ ,]+

Constructors

Token 

Fields

Instances
Pretty Token # 
Instance details

Defined in Distribution.Parsec.Newtypes

Parsec Token # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

parsec :: CabalParsing m => m Token #

Newtype String Token # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

pack :: String -> Token #

unpack :: Token -> String #

newtype Token' #

Haskell string or [^ ]+

Constructors

Token' 

Fields

Instances
Pretty Token' # 
Instance details

Defined in Distribution.Parsec.Newtypes

Parsec Token' # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

parsec :: CabalParsing m => m Token' #

Newtype String Token' # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

pack :: String -> Token' #

unpack :: Token' -> String #

newtype MQuoted a #

Either "quoted" or un-quoted.

Constructors

MQuoted 

Fields

Instances
Newtype a (MQuoted a) # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

pack :: a -> MQuoted a #

unpack :: MQuoted a -> a #

Pretty a => Pretty (MQuoted a) # 
Instance details

Defined in Distribution.Parsec.Newtypes

Parsec a => Parsec (MQuoted a) # 
Instance details

Defined in Distribution.Parsec.Newtypes

Methods

parsec :: CabalParsing m => m (MQuoted a) #

newtype FilePathNT #

Filepath are parsed as Token.

Constructors

FilePathNT