YhcSource codeContentsIndex
Bind
Description

The bindDecls and bindPat function are used by Rename.

The ident* functions collect all identifiers bound within the respective syntactic construct. They are used by several modules.

Synopsis
data Pos
data Decls id
data Decl id
data Exp id
bindDecls :: Decls TokenId -> RenameRMonadEmpty a
bindPat :: IdKind -> Exp TokenId -> RenameRMonadEmpty a
identDecl :: Decl a -> [a]
identPat :: Exp a -> [(Pos, a)]
Documentation
data Pos
abstract type for storing the position of a syntactic construct in a file, that is, line and column number of both start and end positions.
show/hide Instances
Eq Pos
Ord Pos
Show Pos
data Decls id
show/hide Instances
data Decl id
show/hide Instances
data Exp id
used both for expressions and patterns
show/hide Instances
bindDecls :: Decls TokenId -> RenameRMonadEmpty a
Add all identifiers (variables, type constructors, class ids, data constructors,...) that are bound/defined in the syntactic construct to the active names in renameState. Does not look at local declarations of variable definitions (different scope) but at methods of classes and instances. Adds error message to renameState in case of redefinition of an identifier.
bindPat :: IdKind -> Exp TokenId -> RenameRMonadEmpty a
identDecl :: Decl a -> [a]
Collect all variable identifiers that are bound/defined by the declaration in a list. Does not look at local declarations and not at methods of class or instance definitions.
identPat :: Exp a -> [(Pos, a)]
Collect all variable identifiers that are bound by the pattern together with their positions in a list. Argument must be a pattern, not an arbitrary expression.
Produced by Haddock version 0.8