diff --git a/example.jl b/example.jl index 3ed8bd3..f16bca0 100644 --- a/example.jl +++ b/example.jl @@ -1,12 +1,14 @@ defop 2 Left (a ++ b) (a - b) -(qat :: (T -> B -> "wat")) +(qat :: A -> B) def qat (lambda a b c -> (a + b)) def (add a b) (a + b) +def wat [[1,2,3], [4,5,6]] + def (catstrs strs) (foldr f (head strs) diff --git a/representation.js b/representation.js index ff536ac..1f51aeb 100644 --- a/representation.js +++ b/representation.js @@ -62,9 +62,9 @@ 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) { @@ -74,8 +74,6 @@ function isTypeExprRec(stx) { return true; } - - function App(func, p) { this.func = func; this.exprType = "Application"; @@ -270,7 +268,8 @@ function isTypeExpr(expr) { } function TypeApp(expression, type) { - if (isTypeExprRec(expression)) { + if (isTypeExprRec(expression) && + expression.exprType !== "Name") { throw errors.JInternalError( "Left-hand-side of type application must not be in the type language" );