Safe Haskell | None |
---|---|
Language | Haskell2010 |
Language.Haskell
Contents
Description
The programming language Haskell
Synopsis
- parseModule :: Map Extension Bool -> ModuleEnvironment Language -> Environment Language -> Bool -> Text -> ParseResults Input [Bound (Module Language Language Bound Bound)]
- predefinedModuleBindings :: IO (ModuleEnvironment Language)
- preludeBindings :: IO (Environment Language)
- resolvePositions :: (Traversable (Keep (Binder Language Parsed)) node, Traversable (Reorganization Language (Down Int) Input) node, Functor (Mapped ((,) (Attributes Language)) (Map Parsed Placed)) node) => Map Extension Bool -> ModuleEnvironment Language -> Environment Language -> Text -> Parsed (node Parsed Parsed) -> Bound (node Bound Bound)
- type Input = Shadowed Text
- type Parsed = NodeWrap Input
- type Placed = Wrapped Int Text
- type Bound = WithEnvironment Language Placed
Documentation
Arguments
:: Map Extension Bool | language extension switches |
-> ModuleEnvironment Language | modules available for import |
-> Environment Language | names available without import |
-> Bool | verify if the identifiers are bound and extensions used? |
-> Text | the module's source code |
-> ParseResults Input [Bound (Module Language Language Bound Bound)] |
Parse the given text of a single module according to the specified language extensions and resolve all identifiers inside the module.
predefinedModuleBindings :: IO (ModuleEnvironment Language) Source #
All the qualified bindings available without any import statement, such as Prelude.id
preludeBindings :: IO (Environment Language) Source #
All the Prelude
bindings available without any import statement
Arguments
:: (Traversable (Keep (Binder Language Parsed)) node, Traversable (Reorganization Language (Down Int) Input) node, Functor (Mapped ((,) (Attributes Language)) (Map Parsed Placed)) node) | |
=> Map Extension Bool | language extension switches |
-> ModuleEnvironment Language | modules available for import |
-> Environment Language | names available without import |
-> Text | the module's source code for adjusting node positions |
-> Parsed (node Parsed Parsed) | parsed AST |
-> Bound (node Bound Bound) |
Resolve identifiers in the given parsed AST, and replace the stored positions in the entire tree with offsets from the start of the given source text.
Node wrappers
An abstract syntax tree produced by this library contains nodes of different types (declarations, types, expressions, patterns, etc), but every node is contained by the same type of wrapper node.
type Parsed = NodeWrap Input Source #
Every node in a parsed AST is originally wrapped with this functor
type Placed = Wrapped Int Text Source #
Every node in a parsed AST with calculated positions is wrapped with this functor
type Bound = WithEnvironment Language Placed Source #
Every node in a parsed and resolved AST is wrapped with this functor
Orphan instances
(Functor (g (Compose ((,) (Attributes Language)) q)), Functor (Mapped ((,) (Attributes Language)) (Map q Placed)) g) => Functor (Mapped ((,) (Attributes Language)) (Map q Placed)) g Source # | |
Methods (<$>) :: Mapped ((,) (Attributes Language)) (Map q Placed) -> Domain (Mapped ((,) (Attributes Language)) (Map q Placed)) (g (Domain (Mapped ((,) (Attributes Language)) (Map q Placed))) (Domain (Mapped ((,) (Attributes Language)) (Map q Placed)))) -> Codomain (Mapped ((,) (Attributes Language)) (Map q Placed)) (g (Codomain (Mapped ((,) (Attributes Language)) (Map q Placed))) (Codomain (Mapped ((,) (Attributes Language)) (Map q Placed)))) # |