fourmolu-0.17.0.0: A formatter for Haskell source code

Safe Haskell | None
Language | GHC2021

Ormolu.Fixity.Parser

Contents

- Raw parsers
- Internal

Description

Parser for fixity maps.

Synopsis

- parseDotOrmolu :: FilePath -> Text -> Either (ParseErrorBundle Text Void) (FixityOverrides, ModuleReexports)
- parseFixityDeclaration :: Text -> Either (ParseErrorBundle Text Void) [(OpName, FixityInfo)]
- parseModuleReexportDeclaration :: Text -> Either (ParseErrorBundle Text Void) (ModuleName, NonEmpty (Maybe PackageName, ModuleName))
- pFixity :: Parser [(OpName, FixityInfo)]
- pOperator :: Parser OpName
- pModuleName :: Parser ModuleName
- pPackageName :: Parser PackageName
- isIdentifierFirstChar :: Char -> Bool
- isIdentifierConstituent :: Char -> Bool
- isOperatorConstituent :: Char -> Bool
- isPackageNameConstituent :: Char -> Bool
- isModuleSegmentFirstChar :: Char -> Bool
- isModuleSegmentConstituent :: Char -> Bool

# Documentation

parseDotOrmolu #

Arguments

:: FilePath | Location of the file we are parsing (only for parse errors)
-> Text | File contents to parse
-> Either (ParseErrorBundle Text Void) (FixityOverrides, ModuleReexports) | Parse result

Parse textual representation of `FixityOverrides`.

parseFixityDeclaration #

Arguments

:: Text | Text to parse
-> Either (ParseErrorBundle Text Void) [(OpName, FixityInfo)] | Parse result

Parse a single self-contained fixity declaration.

parseModuleReexportDeclaration #

Arguments

:: Text | Text to parse
-> Either (ParseErrorBundle Text Void) (ModuleName, NonEmpty (Maybe PackageName, ModuleName)) | Parse result

Parse a single self-contained module re-export declaration.

# Raw parsers

pFixity :: Parser [(OpName, FixityInfo)] #

Parse a single fixity declaration, such as

    infixr 4 +++, >>>

pOperator :: Parser OpName #

See https://www.haskell.org/onlinereport/haskell2010/haskellch2.html

pModuleName :: Parser ModuleName #

pPackageName :: Parser PackageName #

# Internal

isIdentifierFirstChar :: Char -> Bool #

isIdentifierConstituent :: Char -> Bool #

isOperatorConstituent :: Char -> Bool #

isPackageNameConstituent :: Char -> Bool #

isModuleSegmentFirstChar :: Char -> Bool #

isModuleSegmentConstituent :: Char -> Bool #