From 4c285539eb2b7eba0e95d1a2476d8a8240fa3fe7 Mon Sep 17 00:00:00 2001 From: nisstyre56 Date: Fri, 16 May 2014 20:49:06 -0400 Subject: [PATCH] Removed spurious code from experiments --- representation.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/representation.js b/representation.js index 64f298b..ff536ac 100644 --- a/representation.js +++ b/representation.js @@ -37,26 +37,24 @@ function isIrregularTypeOp(x) { function flattenTypeApp(stx) { if (isTypeExpr(stx)) { - return stx; + return true; } if (stx.exprType === "Application") { /* it might be a type application so recursively check it */ if (stx.p !== undefined) { - return _.flatten([stx, flattenTypeApp(stx.p), flattenTypeApp(stx.func)]); + return _.flatten([flattenTypeApp(stx.p), flattenTypeApp(stx.func)]); } else { - return _.flatten([stx, flattenTypeApp(stx.func)]); + return _.flatten([flattenTypeApp(stx.func)]); } } if (stx.exprType === "Name") { - /* Check if it might be a type operator that is not capitalized */ - if (isIrregularTypeOp(stx.ident)) { - return stx; - } - return { - failed : true, - stx : stx - }; + /* + * Either it is a type operator + * or we assume it is a type variable + * since it was not capitalized + */ + return true; } return { failed : true, @@ -66,6 +64,7 @@ function flattenTypeApp(stx) { function isTypeExprRec(stx) { var flattened = flattenTypeApp(stx); + console.log(flattened); for(var i = 0; i < flattened.length; i++) { if (flattened[i].failed !== undefined && flattened[i].failed) {