     for k, v of map.values
       addToMap concated, k, v
   concated
-
 
 # mycroft = (context, node, environment) ->
 #   if node.label is 'numerical'

  [s2, nextIndex, arg] = infer (subContext s1, context), arg, nextIndex
  s3 = unify (subExp s2, opTea), [arg.tea, returnName]
  [(concat s3, s2, s1), nextIndex, (subExp s3, returnName)]





    addToMap newContext, name, (subExp subs, t)
  newContext

freshenFree = (nameIndex, type) ->
  if Array.isArray type
    [nextIndex, subs] = makeFreshForEach nameIndex, findFrees type
    [nextIndex, (subExp subs, type)]
  else
    [nameIndex, type]

makeFreshForEach = (nameIndex, vars) ->
  subs = newMap()
  for type in setToArray vars
    addToMap subs, type, (freshName nameIndex++)
  [nameIndex, subs]

findFrees = (type) ->
  if Array.isArray type
    concat (for subType in type
      findFrees subType)...
  else
    if isTypeVariable type
      newSetWith type
    else
      newSet()

isTypeVariable = (name) ->
  not (Array.isArray name) and name.charCodeAt(0) >= 97

