libcspm-0.2.0: A library providing a parser, type checker and evaluator for CSPM.

CSPM.DataStructures.Names

Contents

Description

Names used by the evaluator. This is heavily inspired by GHC.

Synopsis

Data Types

data OccName Source

A name that occurs in the source code somewhere.

Constructors

OccName String 

data UnRenamedName Source

A name that has not yet been renamed. Created by the parser.

Constructors

UnQual OccName 

data Name Source

A renamed name and is the exclusive type used after the renamer. Names are guaranteed to be unique, meaning that two names are equal iff they refer to the same binding instance. For example, consider the following CSPM code:

      f = 1
      g = let f = 2 within (f, f)

This will be renamed to:

      f0 = 1
      g = let f1 = 2 within (f1, f1)

Constructors

Name 

Fields

nameType :: NameType

The type of this name.

nameOccurrence :: !OccName

The original occurence of this name (used for error messages).

nameDefinition :: !SrcSpan

Where this name was defined. If this occurs in a pattern, then it will be equal to the location of the pattern, otherwise it will be equal to the location of the definition that this name binds to.

nameUnique :: !Int

The unique identifier for this name. Inserted by the renamer.

nameIsConstructor :: Bool

Is this name a type constructor, i.e. a datatype or a channel?

Instances

Eq Name 
Ord Name 
Show Name 
Typeable Name 
PrettyPrintable Name 
TypeCheckable TCInteractiveStmt () 
TypeCheckable TCExp Type 
TypeCheckable TCPat Type 
TypeCheckable TCMatch Type 
TypeCheckable TCModule () 
TypeCheckable TCDecl [(Name, Type)] 
TypeCheckable TCDataTypeClause (Name, [Type]) 
Desugarable (Pat Name) 
Desugarable (Match Name) 
Desugarable (DataTypeClause Name) 
Desugarable (ModelOption Name) 
Desugarable (Assertion Name) 
Desugarable (Decl Name) 
Desugarable (InteractiveStmt Name) 
Desugarable (Stmt Name) 
Desugarable (Field Name) 
Desugarable (Exp Name) 
Desugarable (Module Name) 
Evaluatable (Exp Name) 
Bindable (Pat Name) 
FreeVars (Pat Name) 
FreeVars (Pat Name) 
FreeVars (Stmt Name) 
FreeVars (Field Name) 
Dependencies (Pat Name) 
Dependencies (Match Name) 
Dependencies (DataTypeClause Name) 
Dependencies (ModelOption Name) 
Dependencies (Assertion Name) 
Dependencies (Decl Name) 
Dependencies (Stmt Name) 
Dependencies (Field Name) 
Dependencies (Exp Name) 
TypeCheckable [TCModule] () 
TypeCheckable (Pat Name) Type 
TypeCheckable (Match Name) Type 
TypeCheckable (ModelOption Name) () 
TypeCheckable (Assertion Name) () 
TypeCheckable (InteractiveStmt Name) () 
TypeCheckable (Exp Name) Type 
TypeCheckable (Module Name) () 
Renamable (Match UnRenamedName) (Match Name) 
Renamable (ModelOption UnRenamedName) (ModelOption Name) 
Renamable (Assertion UnRenamedName) (Assertion Name) 
Renamable (InteractiveStmt UnRenamedName) (InteractiveStmt Name) 
Renamable (Exp UnRenamedName) (Exp Name) 
Renamable (Module UnRenamedName) (Module Name) 
TypeCheckable (Decl Name) [(Name, Type)] 
TypeCheckable (DataTypeClause Name) (Name, [Type]) 
Compressable a => Compressable (Annotated (Maybe SymbolTable, PSymbolTable) a) 

data NameType Source

Constructors

ExternalName

An externally visible name (like a top level definition).

InternalName

A name created by the renamer, but from the users' source (e.g. from a lambda).

WiredInName

A built in name.

Instances

Construction Helpers

Utility Functions

isNameDataConstructor :: Name -> BoolSource

Does the given Name correspond to a data type or a channel definition.