public IType Eval(ITypeEnv typeEnv) { Unique unique = new Unique(); typeEnv = typeEnv.MakeChild(); typeEnv.Add(mTypeVarName, new TVar(unique)); IType type = mTypeExpr.Eval(typeEnv); return new TAbs(unique, type); }
public IType Check( ITypeCtxt typeCtxt, ITypeEnv typeEnv, IValueCtxt valueCtxt ) { Unique unique = new Unique(); typeCtxt = typeCtxt.MakeChild(); typeEnv = typeEnv.MakeChild(); typeCtxt.Add(mTypeVarName, mKind); typeEnv.Add(mTypeVarName, new TVar(unique)); IType type = mValueExpr.Check(typeCtxt, typeEnv, valueCtxt); return MakePolymorphicType(unique, mKind, type); }