Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 public IType Eval(ITypeEnv typeEnv)
 {
     IType type = mTypeExpr.Eval(typeEnv);
     typeEnv.Add(mTypeVarName, type);
     return type;
 }