Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides newtype
wrappers to be used with Distribution.FieldGrammar.
Synopsis
- alaList :: sep -> [a] -> List sep (Identity a) a
- alaList' :: sep -> (a -> b) -> [a] -> List sep b a
- data CommaVCat = CommaVCat
- data CommaFSep = CommaFSep
- data VCat = VCat
- data FSep = FSep
- data NoCommaFSep = NoCommaFSep
- class Sep sep where
- prettySep :: P sep -> [Doc] -> Doc
- parseSep :: CabalParsing m => P sep -> m a -> m [a]
- data List sep b a
- newtype SpecVersion = SpecVersion {}
- newtype TestedWith = TestedWith {}
- newtype SpecLicense = SpecLicense {}
- newtype Token = Token {}
- newtype Token' = Token' {}
- newtype MQuoted a = MQuoted {
- getMQuoted :: a
- newtype FilePathNT = FilePathNT {}
List
Modifiers
Vertical list with commas. Displayed with vcat
Paragraph fill list with commas. Displayed with fsep
Vertical list with optional commas. Displayed with vcat
.
Paragraph fill list with optional commas. Displayed with fsep
.
data NoCommaFSep #
Paragraph fill list without commas. Displayed with fsep
.
Instances
Sep NoCommaFSep # | |
Defined in Distribution.Parsec.Newtypes prettySep :: P NoCommaFSep -> [Doc] -> Doc # parseSep :: CabalParsing m => P NoCommaFSep -> m a -> m [a] # |
Instances
Sep NoCommaFSep # | |
Defined in Distribution.Parsec.Newtypes prettySep :: P NoCommaFSep -> [Doc] -> Doc # parseSep :: CabalParsing m => P NoCommaFSep -> m a -> m [a] # | |
Sep FSep # | |
Defined in Distribution.Parsec.Newtypes | |
Sep VCat # | |
Defined in Distribution.Parsec.Newtypes | |
Sep CommaFSep # | |
Defined in Distribution.Parsec.Newtypes | |
Sep CommaVCat # | |
Defined in Distribution.Parsec.Newtypes |
Type
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) # | |
(Newtype a b, Sep sep, Pretty b) => Pretty (List sep b a) # | |
Defined in Distribution.Parsec.Newtypes 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) # | |
Defined in Distribution.Parsec.Newtypes 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:
- Starting with 2.2 the cabal-version field should be the first field in the
file and only exact version is accepted. Therefore if we get e.g.
>= 2.2
, we fail. See https://github.com/haskell/cabal/issues/4899
Instances
Pretty SpecVersion # | |
Defined in Distribution.Parsec.Newtypes pretty :: SpecVersion -> Doc # prettyVersioned :: CabalSpecVersion -> SpecVersion -> Doc # | |
Parsec SpecVersion # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m SpecVersion # | |
Newtype (Either Version VersionRange) SpecVersion # | |
Defined in Distribution.Parsec.Newtypes pack :: Either Version VersionRange -> SpecVersion # unpack :: SpecVersion -> Either Version VersionRange # |
newtype TestedWith #
Version range or just version
Instances
Pretty TestedWith # | |
Defined in Distribution.Parsec.Newtypes pretty :: TestedWith -> Doc # prettyVersioned :: CabalSpecVersion -> TestedWith -> Doc # | |
Parsec TestedWith # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m TestedWith # | |
Newtype (CompilerFlavor, VersionRange) TestedWith # | |
Defined in Distribution.Parsec.Newtypes pack :: (CompilerFlavor, VersionRange) -> TestedWith # unpack :: TestedWith -> (CompilerFlavor, VersionRange) # |
newtype SpecLicense #
SPDX License expression or legacy license
Instances
Pretty SpecLicense # | |
Defined in Distribution.Parsec.Newtypes pretty :: SpecLicense -> Doc # prettyVersioned :: CabalSpecVersion -> SpecLicense -> Doc # | |
Parsec SpecLicense # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m SpecLicense # | |
Newtype (Either License License) SpecLicense # | |
Defined in Distribution.Parsec.Newtypes |
Identifiers
Haskell string or [^ ,]+
Instances
Pretty Token # | |
Defined in Distribution.Parsec.Newtypes prettyVersioned :: CabalSpecVersion -> Token -> Doc # | |
Parsec Token # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m Token # | |
Newtype String Token # | |
Haskell string or [^ ]+
Instances
Pretty Token' # | |
Defined in Distribution.Parsec.Newtypes prettyVersioned :: CabalSpecVersion -> Token' -> Doc # | |
Parsec Token' # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m Token' # | |
Newtype String Token' # | |
Either "quoted"
or un-quoted
.
MQuoted | |
|
Instances
Newtype a (MQuoted a) # | |
Pretty a => Pretty (MQuoted a) # | |
Defined in Distribution.Parsec.Newtypes prettyVersioned :: CabalSpecVersion -> MQuoted a -> Doc # | |
Parsec a => Parsec (MQuoted a) # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m (MQuoted a) # |
newtype FilePathNT #
Filepath are parsed as Token
.
Instances
Pretty FilePathNT # | |
Defined in Distribution.Parsec.Newtypes pretty :: FilePathNT -> Doc # prettyVersioned :: CabalSpecVersion -> FilePathNT -> Doc # | |
Parsec FilePathNT # | |
Defined in Distribution.Parsec.Newtypes parsec :: CabalParsing m => m FilePathNT # | |
Newtype String FilePathNT # | |
Defined in Distribution.Parsec.Newtypes pack :: String -> FilePathNT # unpack :: FilePathNT -> String # |