Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Haskell.Extensions.Grammar
Description
The grammar(s) of Haskell with syntactic extensions.
The following extensions are not implemented, mainly due to not being supported by TemplateHaskell:
Synopsis
- data ExtendedGrammar l t (f :: Type -> Type) (p :: Type -> Type)
- extendedGrammar :: (ExtendedHaskell l, LexicalParsing (Parser (ExtendedGrammar l t (NodeWrap t)) t), Ord t, Show t, OutlineMonoid t, SpaceMonoid t, DeeplyFoldable (Serialization (Down Int) t) l) => Set Extension -> Grammar (ExtendedGrammar l t (NodeWrap t)) (ParserT ((,) [[Lexeme t]])) t
- parseModule :: (ExtendedHaskell l, LexicalParsing (Parser (ExtendedGrammar l t (NodeWrap t)) t), Ord t, Show t, OutlineMonoid t, SpaceMonoid t, DeeplyFoldable (Serialization (Down Int) t) l) => Map Extension Bool -> t -> ParseResults t [NodeWrap t (Module l l (NodeWrap t) (NodeWrap t))]
- type NodeWrap s = Wrapped (Down Int) s
Documentation
data ExtendedGrammar l t (f :: Type -> Type) (p :: Type -> Type) Source #
Contains the refactored Haskell2010 HaskellGrammar
with additional fields for language extensions
Instances
extendedGrammar :: (ExtendedHaskell l, LexicalParsing (Parser (ExtendedGrammar l t (NodeWrap t)) t), Ord t, Show t, OutlineMonoid t, SpaceMonoid t, DeeplyFoldable (Serialization (Down Int) t) l) => Set Extension -> Grammar (ExtendedGrammar l t (NodeWrap t)) (ParserT ((,) [[Lexeme t]])) t Source #
Construct the Haskell grammar corresponding to the given set of language extensions
parseModule :: (ExtendedHaskell l, LexicalParsing (Parser (ExtendedGrammar l t (NodeWrap t)) t), Ord t, Show t, OutlineMonoid t, SpaceMonoid t, DeeplyFoldable (Serialization (Down Int) t) l) => Map Extension Bool -> t -> ParseResults t [NodeWrap t (Module l l (NodeWrap t) (NodeWrap t))] Source #
Parse a Haskell module using the grammar corresponding to the given set of language extensions and the
extensions specified by the module's LANGUAGE
pragmas.