purescript-0.6.1.2: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

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, NameVisibility)

Value names currently in scope

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

Type names currently in scope

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

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

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

Type synonyms currently in scope

typeClassDictionaries :: Map (Qualified Ident, Maybe ModuleName) TypeClassDictionaryInScope

Available type class dictionaries

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

Type classes

Instances

initEnvironment :: Environment Source

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 NameVisibility Source

The visibility of a name in scope

Constructors

Undefined

The name is defined in the current binding group, but is not visible

Defined

The name is defined in the another binding group, or has been made visible by a function binder

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, Maybe Kind)] [(ProperName, [Type])]

Data type

TypeSynonym

Type synonym

ExternData

Foreign data

LocalTypeVariable

A local type variable

data DataDeclType Source

The type ('data' or 'newtype') of a data type declaration

Constructors

Data

A standard data constructor

Newtype

A newtype constructor

primName :: String -> Qualified ProperName Source

Construct a ProperName in the Prim module

primTy :: String -> Type Source

Construct a type in the Prim module

tyFunction :: Type Source

Type constructor for functions

tyString :: Type Source

Type constructor for strings

tyNumber :: Type Source

Type constructor for numbers

tyBoolean :: Type Source

Type constructor for booleans

tyArray :: Type Source

Type constructor for arrays

tyObject :: Type Source

Type constructor for objects

function :: Type -> Type -> Type Source

Smart constructor for function types

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

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