 
 # Returns a substitution
 mostGeneralUnifier = (t1, t2) ->
+  # log "mgu", (printType t1), (printType t2), (print t1.origin), (print t2.origin)
   if t1.TypeVariable
     bindVariable t1, t2
   else if t2.TypeVariable

    throw new Error "matching on lists not supported yet"
  else
    items = _arguments call
    compiledItems = uniformCollectionCompile ctx, call, items, listType
    assignCompile ctx, call, (irList compiledItems)

ms.Map = ms_Map = (ctx, call) ->

  [conds, someResults] = unzip pairs args
  results = (filter _is, someResults)

  doneConds = termsCompileExpectingType ctx, (markOrigin boolType(), call), conds

  # mark all used as used (or remember them)
  oldUsed = ctx.usedNames()
