purescript-0.3.10: PureScript Programming Language Compiler

Safe HaskellNone



Data types for types



newtype SkolemScope Source

An identifier for the scope of a skolem variable




runSkolemScope :: Int

data Type Source

The type of types


TUnknown Unknown

A unification variable of type Type

Object Type

Javascript numbers

TypeVar String

A named type variable

TypeConstructor (Qualified ProperName)

A type constructor

TypeApp Type Type

A type application

SaturatedTypeSynonym (Qualified ProperName) [Type]

A type synonym which is "saturated", i.e. fully applied

ForAll String Type (Maybe SkolemScope)

Forall quantifier

ConstrainedType [(Qualified ProperName, Type)] Type

A type with a set of type class constraints

Skolem Int SkolemScope

A skolem constant


An empty row

RCons String Type Type

A non-empty row

PrettyPrintFunction Type Type

A placeholder used in pretty printing

PrettyPrintArray Type

A placeholder used in pretty printing

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

function :: Type -> Type -> TypeSource

Smart constructor for function types

rowToList :: Type -> ([(String, Type)], Type)Source

Convert a row to a list of pairs of labels and types

rowFromList :: ([(String, Type)], Type) -> TypeSource

Convert a list of labels and types to a row

isMonoType :: Type -> BoolSource

Check whether a type is a monotype

mkForAll :: [String] -> Type -> TypeSource

Universally quantify a type

unit :: TypeSource

The empty record type

replaceTypeVars :: Data d => String -> Type -> d -> dSource

Replace a type variable, taking into account variable shadowing