purescript-0.4.0: PureScript Programming Language Compiler

Safe HaskellNone

Language.PureScript.Declarations

Description

Data types for modules and declarations

Synopsis

Documentation

type Precedence = IntegerSource

A precedence level for an infix operator

data Associativity Source

Associativity for infix operators

Constructors

Infixl 
Infixr 

data Fixity Source

Fixity data for infix operators

data Module Source

A module declaration, consisting of a module name and a list of declarations

Constructors

Module ProperName [Declaration] 

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

TypeClassDictionaryImport

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

TypeClassAccessorImport

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

data Declaration Source

The data type of declarations

Constructors

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

A data type declaration (name, arguments, data constructors)

DataBindingGroupDeclaration [Declaration]

A minimal mutually recursive set of data type declarations

TypeSynonymDeclaration ProperName [String] Type

A type synonym declaration (name, arguments, type)

TypeDeclaration Ident Type

A type declaration for a value (name, ty)

ValueDeclaration Ident [Binder] (Maybe Guard) Value

A value declaration (name, top-level binders, optional guard, value)

BindingGroupDeclaration [(Ident, Value)]

A minimal mutually recursive set of value declarations

ExternDeclaration ForeignImportType Ident (Maybe JS) Type

A foreign import declaration (type, name, optional inline Javascript, type)

ExternDataDeclaration ProperName Kind

A data type foreign import (name, kind)

FixityDeclaration Fixity String

A fixity declaration (fixity data, operator name)

ImportDeclaration ModuleName (Maybe [Either Ident ProperName])

A module import (module name, optional set of identifiers to import)

TypeClassDeclaration ProperName String [Declaration]

A type class declaration (name, argument, member declarations)

TypeInstanceDeclaration [(Qualified ProperName, Type)] (Qualified ProperName) Type [Declaration]

A type instance declaration (dependencies, class name, instance type, member declarations)

isValueDecl :: Declaration -> BoolSource

Test if a declaration is a value declaration

isDataDecl :: Declaration -> BoolSource

Test if a declaration is a data type or type synonym declaration

isImportDecl :: Declaration -> BoolSource

Test if a declaration is a module import

isExternDataDecl :: Declaration -> BoolSource

Test if a declaration is a data type foreign import

isFixityDecl :: Declaration -> BoolSource

Test if a declaration is a fixity declaration

isExternDecl :: Declaration -> BoolSource

Test if a declaration is a foreign import

isTypeClassDeclaration :: Declaration -> BoolSource

Test if a declaration is a type class or instance declaration