Distribution.Parsec.Class

Cabal-2.1.0.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Parsec.Class

Contents

- Warnings
- Utilities

Synopsis

- class Parsec a where
- type ParsecParser a = forall s. Stream s Identity Char => Parsec s [PWarning] a
- simpleParsec :: Parsec a => String -> Maybe a
- parsecWarning :: PWarnType -> String -> Parsec s [PWarning] ()
- data PWarnType
  - = PWTOther
  - | PWTUTF
  - | PWTBoolCase
  - | PWTVersionTag
  - | PWTNewSyntax
  - | PWTOldSyntax
  - | PWTDeprecatedField
  - | PWTInvalidSubsection
  - | PWTUnknownField
  - | PWTUnknownSection
  - | PWTTrailingFields
  - | PWTExtraMainIs
  - | PWTExtraTestModule
  - | PWTExtraBenchmarkModule
  - | PWTLexNBSP
  - | PWTLexBOM
  - | PWTQuirkyCabalFile
- parsecToken :: Stream s Identity Char => Parsec s [PWarning] String
- parsecToken' :: Stream s Identity Char => Parsec s [PWarning] String
- parsecFilePath :: Stream s Identity Char => Parsec s [PWarning] FilePath
- parsecQuoted :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] a
- parsecMaybeQuoted :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] a
- parsecCommaList :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] [a]
- parsecOptCommaList :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] [a]
- parsecStandard :: (Parsec ver, Stream s Identity Char) => (ver -> String -> a) -> Parsec s [PWarning] a
- parsecUnqualComponentName :: Stream s Identity Char => Parsec s [PWarning] String

# Documentation

class Parsec a where Source #

TODO: implementation details: should be careful about consuming trailing whitespace? Should we always consume it?

Minimal complete definition

parsec

Methods

parsec :: ParsecParser a Source #

lexemeParsec :: ParsecParser a Source #

`parsec` could consume trailing spaces, this function must consume.

Instances

Parsec Bool # |
Instance details Methods parsec :: ParsecParser Bool Source # lexemeParsec :: ParsecParser Bool Source #
Parsec BuildType # |
Instance details Methods parsec :: ParsecParser BuildType Source # lexemeParsec :: ParsecParser BuildType Source #
Parsec ExecutableScope # |
Instance details Methods parsec :: ParsecParser ExecutableScope Source # lexemeParsec :: ParsecParser ExecutableScope Source #
Parsec ForeignLibOption # |
Instance details Methods parsec :: ParsecParser ForeignLibOption Source # lexemeParsec :: ParsecParser ForeignLibOption Source #
Parsec ForeignLibType # |
Instance details Methods parsec :: ParsecParser ForeignLibType Source # lexemeParsec :: ParsecParser ForeignLibType Source #
Parsec Version # |
Instance details Methods parsec :: ParsecParser Version Source # lexemeParsec :: ParsecParser Version Source #
Parsec VersionRange # |
Instance details Methods parsec :: ParsecParser VersionRange Source # lexemeParsec :: ParsecParser VersionRange Source #
Parsec PkgconfigName # |
Instance details Methods parsec :: ParsecParser PkgconfigName Source # lexemeParsec :: ParsecParser PkgconfigName Source #
Parsec ComponentId # |
Instance details Methods parsec :: ParsecParser ComponentId Source # lexemeParsec :: ParsecParser ComponentId Source #
Parsec ModuleName # |
Instance details Methods parsec :: ParsecParser ModuleName Source # lexemeParsec :: ParsecParser ModuleName Source #
Parsec ModuleRenaming # |
Instance details Methods parsec :: ParsecParser ModuleRenaming Source # lexemeParsec :: ParsecParser ModuleRenaming Source #
Parsec IncludeRenaming # |
Instance details Methods parsec :: ParsecParser IncludeRenaming Source # lexemeParsec :: ParsecParser IncludeRenaming Source #
Parsec RepoType # |
Instance details Methods parsec :: ParsecParser RepoType Source # lexemeParsec :: ParsecParser RepoType Source #
Parsec RepoKind # |
Instance details Methods parsec :: ParsecParser RepoKind Source # lexemeParsec :: ParsecParser RepoKind Source #
Parsec Platform # |
Instance details Methods parsec :: ParsecParser Platform Source # lexemeParsec :: ParsecParser Platform Source #
Parsec Arch # |
Instance details Methods parsec :: ParsecParser Arch Source # lexemeParsec :: ParsecParser Arch Source #
Parsec OS # |
Instance details Methods parsec :: ParsecParser OS Source # lexemeParsec :: ParsecParser OS Source #
Parsec TestType # |
Instance details Methods parsec :: ParsecParser TestType Source # lexemeParsec :: ParsecParser TestType Source #
Parsec PkgconfigDependency # |
Instance details Methods parsec :: ParsecParser PkgconfigDependency Source # lexemeParsec :: ParsecParser PkgconfigDependency Source #
Parsec BenchmarkType # |
Instance details Methods parsec :: ParsecParser BenchmarkType Source # lexemeParsec :: ParsecParser BenchmarkType Source #
Parsec License # |
Instance details Methods parsec :: ParsecParser License Source # lexemeParsec :: ParsecParser License Source #
Parsec Extension # |
Instance details Methods parsec :: ParsecParser Extension Source # lexemeParsec :: ParsecParser Extension Source #
Parsec Language # |
Instance details Methods parsec :: ParsecParser Language Source # lexemeParsec :: ParsecParser Language Source #
Parsec CompilerFlavor # |
Instance details Methods parsec :: ParsecParser CompilerFlavor Source # lexemeParsec :: ParsecParser CompilerFlavor Source #
Parsec FilePathNT # |
Instance details Methods parsec :: ParsecParser FilePathNT Source # lexemeParsec :: ParsecParser FilePathNT Source #
Parsec FreeText # |
Instance details Methods parsec :: ParsecParser FreeText Source # lexemeParsec :: ParsecParser FreeText Source #
Parsec TestedWith # |
Instance details Methods parsec :: ParsecParser TestedWith Source # lexemeParsec :: ParsecParser TestedWith Source #
Parsec SpecVersion # |
Instance details Methods parsec :: ParsecParser SpecVersion Source # lexemeParsec :: ParsecParser SpecVersion Source #
Parsec Token' # |
Instance details Methods parsec :: ParsecParser Token' Source # lexemeParsec :: ParsecParser Token' Source #
Parsec Token # |
Instance details Methods parsec :: ParsecParser Token Source # lexemeParsec :: ParsecParser Token Source #
Parsec PackageName # |
Instance details Methods parsec :: ParsecParser PackageName Source # lexemeParsec :: ParsecParser PackageName Source #
Parsec UnqualComponentName # |
Instance details Methods parsec :: ParsecParser UnqualComponentName Source # lexemeParsec :: ParsecParser UnqualComponentName Source #
Parsec DefUnitId # |
Instance details Methods parsec :: ParsecParser DefUnitId Source # lexemeParsec :: ParsecParser DefUnitId Source #
Parsec UnitId # | The textual format for `UnitId` coincides with the format GHC accepts for `-package-id`.
Instance details Methods parsec :: ParsecParser UnitId Source # lexemeParsec :: ParsecParser UnitId Source #
Parsec Module # |
Instance details Methods parsec :: ParsecParser Module Source # lexemeParsec :: ParsecParser Module Source #
Parsec ModuleReexport # |
Instance details Methods parsec :: ParsecParser ModuleReexport Source # lexemeParsec :: ParsecParser ModuleReexport Source #
Parsec Mixin # |
Instance details Methods parsec :: ParsecParser Mixin Source # lexemeParsec :: ParsecParser Mixin Source #
Parsec ExeDependency # |
Instance details Methods parsec :: ParsecParser ExeDependency Source # lexemeParsec :: ParsecParser ExeDependency Source #
Parsec Dependency # |
Instance details Methods parsec :: ParsecParser Dependency Source # lexemeParsec :: ParsecParser Dependency Source #
Parsec LegacyExeDependency # |
Instance details Methods parsec :: ParsecParser LegacyExeDependency Source # lexemeParsec :: ParsecParser LegacyExeDependency Source #
Parsec LibVersionInfo # |
Instance details Methods parsec :: ParsecParser LibVersionInfo Source # lexemeParsec :: ParsecParser LibVersionInfo Source #
Parsec FlagName # |
Instance details Methods parsec :: ParsecParser FlagName Source # lexemeParsec :: ParsecParser FlagName Source #
Parsec TestShowDetails # |
Instance details Methods parsec :: ParsecParser TestShowDetails Source # lexemeParsec :: ParsecParser TestShowDetails Source #
Parsec a => Parsec (Identity a) # |
Instance details Methods parsec :: ParsecParser (Identity a) Source # lexemeParsec :: ParsecParser (Identity a) Source #
Parsec a => Parsec (MQuoted a) # |
Instance details Methods parsec :: ParsecParser (MQuoted a) Source # lexemeParsec :: ParsecParser (MQuoted a) Source #
(Newtype b a, Sep sep, Parsec b) => Parsec (List sep b a) # |
Instance details Methods parsec :: ParsecParser (List sep b a) Source # lexemeParsec :: ParsecParser (List sep b a) Source #

type ParsecParser a = forall s. Stream s Identity Char => Parsec s [PWarning] a Source #

simpleParsec :: Parsec a => String -> Maybe a Source #

Parse a `String` with `lexemeParsec`.

# Warnings

parsecWarning :: PWarnType -> String -> Parsec s [PWarning] () Source #

data PWarnType Source #

Type of parser warning. We do classify warnings.

Different application may decide not to show some, or have fatal behaviour on others

Constructors

PWTOther | Unclassified warning
PWTUTF | Invalid UTF encoding
PWTBoolCase | `true` or `false`, not `True` or `False`
PWTVersionTag | there are version with tags
PWTNewSyntax | New syntax used, but no `cabal-version: >= 1.2` specified
PWTOldSyntax | Old syntax used, and `cabal-version >= 1.2` specified
PWTDeprecatedField |
PWTInvalidSubsection |
PWTUnknownField |
PWTUnknownSection |
PWTTrailingFields |
PWTExtraMainIs | extra main-is field
PWTExtraTestModule | extra test-module field
PWTExtraBenchmarkModule | extra benchmark-module field
PWTLexNBSP |
PWTLexBOM |
PWTQuirkyCabalFile | legacy cabal file that we know how to patch

Instances

Bounded PWarnType # |
Instance details Methods minBound :: PWarnType Source # maxBound :: PWarnType Source #
Enum PWarnType # |
Instance details Methods succ :: PWarnType -> PWarnType Source # pred :: PWarnType -> PWarnType Source # toEnum :: Int -> PWarnType Source # fromEnum :: PWarnType -> Int Source # enumFrom :: PWarnType -> [PWarnType] Source # enumFromThen :: PWarnType -> PWarnType -> [PWarnType] Source # enumFromTo :: PWarnType -> PWarnType -> [PWarnType] Source # enumFromThenTo :: PWarnType -> PWarnType -> PWarnType -> [PWarnType] Source #
Eq PWarnType # |
Instance details Methods (==) :: PWarnType -> PWarnType -> Bool # (/=) :: PWarnType -> PWarnType -> Bool #
Ord PWarnType # |
Instance details Methods compare :: PWarnType -> PWarnType -> Ordering # (<) :: PWarnType -> PWarnType -> Bool # (<=) :: PWarnType -> PWarnType -> Bool # (>) :: PWarnType -> PWarnType -> Bool # (>=) :: PWarnType -> PWarnType -> Bool # max :: PWarnType -> PWarnType -> PWarnType # min :: PWarnType -> PWarnType -> PWarnType #
Show PWarnType # |
Instance details Methods showsPrec :: Int -> PWarnType -> ShowS Source # show :: PWarnType -> String Source # showList :: [PWarnType] -> ShowS Source #

# Utilities

parsecToken :: Stream s Identity Char => Parsec s [PWarning] String Source #

    [^ ,]

parsecToken' :: Stream s Identity Char => Parsec s [PWarning] String Source #

    [^ ]

parsecFilePath :: Stream s Identity Char => Parsec s [PWarning] FilePath Source #

parsecQuoted :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] a Source #

Content isn't unquoted

parsecMaybeQuoted :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] a Source #

`parsecMaybeQuoted p = `parsecQuoted` p | p`.

parsecCommaList :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] [a] Source #

parsecOptCommaList :: Stream s Identity Char => Parsec s [PWarning] a -> Parsec s [PWarning] [a] Source #

parsecStandard :: (Parsec ver, Stream s Identity Char) => (ver -> String -> a) -> Parsec s [PWarning] a Source #

Parse a benchmark/test-suite types.

parsecUnqualComponentName :: Stream s Identity Char => Parsec s [PWarning] String Source #