glam
Safe HaskellSafe-Inferred
LanguageHaskell2010

Glam.Type

Description

The basic syntax and operations on types.

Synopsis

Documentation

type TVar = String Source #

Type variables

type TSubst = Map TVar Type Source #

Type substitutions

type Constancy = Bool Source #

Whether a type, or term, is constant. Note that False means "we don't know".

data Guardedness Source #

A fixed point variable can only be used when it is guarded by a modality.

Constructors

Unguarded

Can't use it yet

Guarded

OK, under

Forbidden

No way, we're under

Instances

Instances details
Eq Guardedness Source # 
Instance details

Defined in Glam.Type

data Type Source #

Monomorphic types of the guarded λ-calculus

Constructors

TVar TVar

Variables

TInt

Integers

TApp Type Type

Applications

One 
Type :*: Type infixr 7

Products

Zero 
Type :+: Type infixr 6

Sums

Type :->: Type infixr 5

Functions

Later Type

modality

Constant Type

modality

TFix TVar Type

Fixed points

Instances

Instances details
IsString Type Source # 
Instance details

Defined in Glam.Type

Methods

fromString :: String -> Type #

Show Type Source # 
Instance details

Defined in Glam.Type

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Eq Type Source # 
Instance details

Defined in Glam.Type

Methods

(==) :: Type -> Type -> Bool #

(/=) :: Type -> Type -> Bool #

Constant Type Source #

A type is constant if all uses of occur under .

Instance details

Defined in Glam.Rules.Term

Types Type Source # 
Instance details

Defined in Glam.Rules.Term

Methods

(!:) :: MonadCheckTerm m => Term -> Type -> m () Source #

(?:) :: MonadCheckTerm m => Term -> m Type Source #

Zonk Type Source # 
Instance details

Defined in Glam.Rules.Term

Methods

zonk :: MonadCheckTerm m => Type -> m Type Source #

HasTVars Type Source # 
Instance details

Defined in Glam.Type

data Polytype Source #

Polymorphic type schemes

Constructors

Forall [(TVar, Constancy)] Type 

Instances

Instances details
Show Polytype Source # 
Instance details

Defined in Glam.Type

Eq Polytype Source # 
Instance details

Defined in Glam.Type

Constant Polytype Source # 
Instance details

Defined in Glam.Rules.Term

Types Polytype Source # 
Instance details

Defined in Glam.Rules.Term

Zonk Polytype Source # 
Instance details

Defined in Glam.Rules.Term

HasTVars Polytype Source # 
Instance details

Defined in Glam.Type

pattern Monotype :: Type -> Polytype Source #

Variables and substitution

class HasTVars t where Source #

Methods

freeTVars :: t -> Set TVar Source #

allTVars :: t -> Set TVar Source #

Instances

Instances details
HasTVars Polytype Source # 
Instance details

Defined in Glam.Type

HasTVars Type Source # 
Instance details

Defined in Glam.Type

Printing

prodPrec :: Num a => a Source #

sumPrec :: Num a => a Source #

funPrec :: Num a => a Source #

modPrec :: Num a => a Source #

appPrec :: Num a => a Source #

Parsing