 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) ->


compileFn = (node) ->
  {params, body, wheres} = fnDefinition node
  """$curry(function (#{params.map(getToken).map(validIdentifier).join ', '}) {
       #{compileFnImpl body, wheres, yes}
     })"""

fnDefinition = (node) ->
  words = inside node
  [keyword, paramList, defs...] = words
  params = if Array.isArray(paramList) then inside paramList else undefined
  defs ?= []
  for def, i in defs
    if matchNode '::', def
