language-haskell
Safe HaskellNone
LanguageHaskell2010

Language.Haskell

Description

The programming language Haskell

Synopsis

Documentation

parseModule Source #

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

resolvePositions Source #

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.

type Input = Shadowed Text Source #

The input monoid type

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