 
 findDefinitions = (ctx, names) ->
   auxiliaries = ctx.auxiliaries()
+  alreadyDefined = newSet()
   concat (for name in names
-    (lookupInMap auxiliaries, name)?.definition or [])
+    aux = (lookupInMap auxiliaries, name)
+    if aux and not inSet alreadyDefined, name
+      addAllToSet alreadyDefined, aux.defines
+      aux.definition
+    else
+      [])
 
 findDeps = (ctx) -> (names) ->
   auxiliaries = ctx.auxiliaries()

  # TODO: should we support bare records?
  #   [a: 2 b: 3]
  if not ctx.shouldDefer()
    form.tea = tupleOfTypes map _tea, elems

  if ctx.assignTo()
    combinePatterns compiledElems

printIr = (ast) ->
  walkIr ast, (ast) ->
    args = {}
    for name, node of ast when name not in ['js', 'ir']
      args[name] =
        if node?
          if name is 'type'
            (printType node)
          else
            printIr node
        else
          undefined
    args
