Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
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
:: 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 Source #
:: Text | Text to parse |
-> Either (ParseErrorBundle Text Void) [(OpName, FixityInfo)] | Parse result |
Parse a single self-contained fixity declaration.
parseModuleReexportDeclaration Source #
:: 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)] Source #
Parse a single fixity declaration, such as
infixr 4 +++, >>>
pModuleName :: Parser ModuleName Source #
pPackageName :: Parser PackageName Source #
Internal
isIdentifierFirstChar :: Char -> Bool Source #
isIdentifierConstituent :: Char -> Bool Source #
isOperatorConstituent :: Char -> Bool Source #
isPackageNameConstituent :: Char -> Bool Source #
isModuleSegmentFirstChar :: Char -> Bool Source #