 labelWhere = (wheres) ->
   for [name, def] in wheres
     labelNames name
-    if matchNode 'fn', def
-      labelRecursiveCall def, name.token
+    if def
+      if matchNode 'fn', def
+        labelRecursiveCall def, name.token
   return
 
 labelParams = (ast, params) ->
   paramNames = (token for {token} in params)
   mapTokens paramNames, ast, (word) ->
-    word.label = 'param' unless word.label
+    word.label = 'param' unless word.label and word.label isnt 'recurse'
 
 labelRecursiveCall = (ast, fnname) ->
   mapTokens [fnname], ast, (word) ->
-    word.label = 'recurse'
+    word.label = 'recurse' if word.label isnt 'param'
 
 typeDatas = (ast) ->
   macro 'data', ast, (node) ->

    {params, body, wheres} = fnDefinition node
    labelFnBody body
    labelWhere wheres
    labelParams node, params
    node

labelFnBody = (node) ->

  "#{wheres.map(compileDef).join '\n'}"

compileDef = ([name, def]) ->
  if !def?
    throw new Error 'missing definition in assignment'
  pm = patternMatch(name, compileImpl def)
  pm.precs.filter(({cache}) -> cache).map(({cache}) -> cache)
  .concat(pm.assigns).map(compileAssign).join '\n'
