purescript-0.5.1: PureScript Programming Language Compiler

Safe HaskellNone

Language.PureScript.Environment

Description

 

Synopsis

Documentation

data Environment Source

The Environment defines all values and types which are currently in scope:

Constructors

Environment 

Fields

names :: Map (ModuleName, Ident) (Type, NameKind)

Value names currently in scope

types :: Map (Qualified ProperName) (Kind, TypeKind)

Type names currently in scope

dataConstructors :: Map (Qualified ProperName) (ProperName, Type)

Data constructors currently in scope, along with their associated data type constructors

typeSynonyms :: Map (Qualified ProperName) ([String], Type)

Type synonyms currently in scope

typeClassDictionaries :: [TypeClassDictionaryInScope]

Available type class dictionaries

typeClasses :: Map (Qualified ProperName) ([String], [(Ident, Type)], [(Qualified ProperName, [Type])])

Type classes

Instances

initEnvironment :: EnvironmentSource

The initial environment with no values and only the default javascript types defined

data ForeignImportType Source

The type of a foreign import

Constructors

ForeignImport

A regular foreign import

InlineJavascript

A foreign import which contains inline Javascript as a string literal

data NameKind Source

The kind of a name

Constructors

Value

A value introduced as a binding in a module

TypeClassAccessorImport

A type class dictionary member accessor import, generated during desugaring of type class declarations

Extern ForeignImportType

A foreign import

LocalVariable

A local name introduced using a lambda abstraction, variable introduction or binder

DataConstructor

A data constructor

TypeInstanceDictionaryValue

A type class dictionary, generated during desugaring of type class declarations

data TypeKind Source

The kinds of a type

Constructors

DataType [String] [(ProperName, [Type])]

Data type

TypeSynonym

Type synonym

ExternData

Foreign data

LocalTypeVariable

A local type variable

primName :: String -> Qualified ProperNameSource

Construct a ProperName in the Prim module

primTy :: String -> TypeSource

Construct a type in the Prim module

tyFunction :: TypeSource

Type constructor for functions

tyString :: TypeSource

Type constructor for strings

tyNumber :: TypeSource

Type constructor for numbers

tyBoolean :: TypeSource

Type constructor for booleans

tyArray :: TypeSource

Type constructor for arrays

tyObject :: TypeSource

Type constructor for objects

function :: Type -> Type -> TypeSource

Smart constructor for function types

primTypes :: Map (Qualified ProperName) (Kind, TypeKind)Source

The primitive types in the external javascript environment with their associated kinds.