     @variableIndex = 0
     @typeVariabeIndex = 0
     @nameIndex = 1
-    @substitution = newMap()
+    @substitution = emptySubstitution()
     @statement = []
     @cacheScopes = [[]]
     @_assignTos = []

  compiledExpression = compileCtxAstToJs topLevelExpression, ctx, expression
  (attachPrintedTypes ctx, expression)
  types: ctx._scope()
  subs: filterMap ((name) -> name is 'could not unify'), ctx.substitution
  ast: ast
  compiled: library + immutable + compiledDefinitions.js + compiledExpression.js



printType = (type) ->
  if type instanceof TypeVariable
    "#{type.name}"
  else if type instanceof QuantifiedVar
    "#{type.var}"
  else if type instanceof TypeConstr
    "#{type.name}"
  else if type instanceof TypeApp
    flattenType collectArgs type
  else if type instanceof ForAll
