 #     [x, xs...] = elems
 #     (call_ (token_ 'cons-array'), [x, (arrayToConses xs)])
 
+typeConstrainedCompile = (call) ->
+  [type, constraints...] = _arguments call
+  new Constrained (typeConstraintsCompile constraints), typeCompile type
 
 typeCompile = (expression) ->
   throw new Error "invalid typeCompile args" unless expression


listOf = (args) ->
  args.join ', '

isComment = (expression) ->
  (isCall expression) and ('#' is _symbol _operator expression)

    newMapWith variable.name, type

# Returns a substitution
matchType = (ctx, t1, t2) ->
  if t1 instanceof TypeVariable and kindsEq (kind t1), (kind t2)
    newMapWith t1.name, t2
  else if t1 instanceof TypeConstr and t2 instanceof TypeConstr and
    t1.name is t2.name
      emptySubstitution()
  else if t1 instanceof TypeApp and t2 instanceof TypeApp
    s1 = matchType t1.op, t2.op
    s2 = matchType t1.arg, t2.arg
    s3 = mergeSubs s1, s2
    s3 or
      newMapWith "could not unify", [(printType t1), (printType t2)]
