purescript-0.4.18.1: PureScript Programming Language Compiler

Safe HaskellNone

Language.PureScript.Types

Description

Data types for types

Synopsis

Documentation

newtype SkolemScope Source

An identifier for the scope of a skolem variable

Constructors

SkolemScope 

Fields

runSkolemScope :: Int
 

data Type Source

The type of types

Constructors

TUnknown Unknown

A unification variable of type Type

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 String Int SkolemScope

A skolem constant

REmpty

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

PrettyPrintObject Type

A placeholder used in pretty printing

PrettyPrintForAll [String] Type

A placeholder used in pretty printing

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

replaceTypeVars :: String -> Type -> Type -> TypeSource

Replace a type variable, taking into account variable shadowing

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

Replace named type variables with types

usedTypeVariables :: Type -> [String]Source

Collect all type variables appearing in a type

freeTypeVariables :: Type -> [String]Source

Collect all free type variables appearing in a type

quantify :: Type -> TypeSource

Universally quantify over all type variables appearing free in a type

moveQuantifiersToFront :: Type -> TypeSource

Move all universal quantifiers to the front of a type

sndM :: Functor f => (b -> f c) -> (a, b) -> f (a, c)Source

everythingOnTypes :: (r -> r -> r) -> (Type -> r) -> Type -> rSource