Versions in this module Expand all Collapse all v1 v1.1.0-working Mar 8, 2018 v1.0.0 Sep 17, 2017 Changes in this version + func BorrowMSubs() mSubs + func BorrowSSubs(size int) *sSubs + func ReturnFnType(fnt *FunctionType) + func ReturnSubs(sub Subs) + func ReturnTypeVarSet(ts TypeVarSet) + func ReturnTypes(ts Types) + type Apply interface + Fn func() Expression + type Cloner interface + Clone func() interface{} + type Constraint struct + func (c Constraint) Apply(sub Subs) Substitutable + func (c Constraint) Format(state fmt.State, r rune) + func (c Constraint) FreeTypeVar() TypeVarSet + type Constraints []Constraint + func (cs Constraints) Apply(sub Subs) Substitutable + func (cs Constraints) Format(state fmt.State, c rune) + func (cs Constraints) FreeTypeVar() TypeVarSet + type Env interface + Add func(string, *Scheme) Env + Clone func() Env + Remove func(string) Env + SchemeOf func(string) (*Scheme, bool) + type Expression interface + Body func() Expression + type Fresher interface + Fresh func() TypeVariable + type FunctionType struct + func NewFnType(ts ...Type) *FunctionType + func (t *FunctionType) Apply(sub Subs) Substitutable + func (t *FunctionType) Arg() Type + func (t *FunctionType) Clone() interface{} + func (t *FunctionType) Eq(other Type) bool + func (t *FunctionType) FlatTypes() Types + func (t *FunctionType) Format(s fmt.State, c rune) + func (t *FunctionType) FreeTypeVar() TypeVarSet + func (t *FunctionType) Name() string + func (t *FunctionType) Normalize(k, v TypeVarSet) (Type, error) + func (t *FunctionType) Ret(recursive bool) Type + func (t *FunctionType) String() string + func (t *FunctionType) Types() Types + type Inferer interface + Infer func(Env, Fresher) (Type, error) + type Lambda interface + IsLambda func() bool + type Let interface + Def func() Expression + type LetRec interface + IsRecursive func() bool + type Literal interface + IsLit func() bool + type Namer interface + Name func() string + type Record struct + func NewRecordType(name string, ts ...Type) *Record + func (t *Record) Apply(subs Subs) Substitutable + func (t *Record) Clone() interface{} + func (t *Record) Eq(other Type) bool + func (t *Record) Format(f fmt.State, c rune) + func (t *Record) FreeTypeVar() TypeVarSet + func (t *Record) Name() string + func (t *Record) Normalize(k, v TypeVarSet) (Type, error) + func (t *Record) String() string + func (t *Record) Types() Types + type Scheme struct + func Generalize(env Env, t Type) *Scheme + func Infer(env Env, expr Expression) (*Scheme, error) + func NewScheme(tvs TypeVarSet, t Type) *Scheme + func (s *Scheme) Apply(sub Subs) Substitutable + func (s *Scheme) Clone() *Scheme + func (s *Scheme) Format(state fmt.State, c rune) + func (s *Scheme) FreeTypeVar() TypeVarSet + func (s *Scheme) Normalize() (err error) + func (s *Scheme) Type() (t Type, isMonoType bool) + type SimpleEnv map[string]*Scheme + func (e SimpleEnv) Add(name string, s *Scheme) Env + func (e SimpleEnv) Apply(sub Subs) Substitutable + func (e SimpleEnv) Clone() Env + func (e SimpleEnv) FreeTypeVar() TypeVarSet + func (e SimpleEnv) Remove(name string) Env + func (e SimpleEnv) SchemeOf(name string) (retVal *Scheme, ok bool) + type Subs interface + Add func(TypeVariable, Type) Subs + Clone func() Subs + Get func(TypeVariable) (Type, bool) + Iter func() []Substitution + Remove func(TypeVariable) Subs + Size func() int + func Unify(a, b Type) (sub Subs, err error) + type Substitutable interface + Apply func(Subs) Substitutable + FreeTypeVar func() TypeVarSet + type Substitution struct + T Type + Tv TypeVariable + type Type interface + Eq func(Type) bool + Name func() string + Normalize func(TypeVarSet, TypeVarSet) (Type, error) + Types func() Types + func Instantiate(f Fresher, s *Scheme) Type + type TypeConst string + func (t TypeConst) Apply(Subs) Substitutable + func (t TypeConst) Eq(other Type) bool + func (t TypeConst) Format(s fmt.State, c rune) + func (t TypeConst) FreeTypeVar() TypeVarSet + func (t TypeConst) Name() string + func (t TypeConst) Normalize(k, v TypeVarSet) (Type, error) + func (t TypeConst) String() string + func (t TypeConst) Types() Types + type TypeVarSet []TypeVariable + func BorrowTypeVarSet(size int) TypeVarSet + func (s TypeVarSet) Contains(tv TypeVariable) bool + func (s TypeVarSet) Difference(other TypeVarSet) TypeVarSet + func (s TypeVarSet) Equals(other TypeVarSet) bool + func (s TypeVarSet) Index(tv TypeVariable) int + func (s TypeVarSet) Intersect(other TypeVarSet) TypeVarSet + func (s TypeVarSet) Len() int + func (s TypeVarSet) Less(i, j int) bool + func (s TypeVarSet) Set() TypeVarSet + func (s TypeVarSet) Swap(i, j int) + func (s TypeVarSet) Union(other TypeVarSet) TypeVarSet + type TypeVariable rune + func (t TypeVariable) Apply(sub Subs) Substitutable + func (t TypeVariable) Eq(other Type) bool + func (t TypeVariable) Format(s fmt.State, c rune) + func (t TypeVariable) FreeTypeVar() TypeVarSet + func (t TypeVariable) Name() string + func (t TypeVariable) Normalize(k, v TypeVarSet) (Type, error) + func (t TypeVariable) String() string + func (t TypeVariable) Types() Types + type Typer interface + Type func() Type + type Types []Type + func BorrowTypes(size int) Types + func (ts Types) Contains(t Type) bool + type Var interface