       rawType: def.type
       score: score
     isTyped = (completion) ->
-      completion.score isnt -Infinity
+      completion.score isnt UNTYPED_PENALTY
 
     partitionMap isTyped, (mapMap scoreAndPrint, validDefinitions))
   values concatMaps typed..., untyped...

    # typesUnify = (def) ->
    #   not isFailed mostGeneralUnifier (freshInstance ctx, def.type).type, type.type
    # [typed, notTyped] = partitionMap typesUnify, validDefinitions
    scoreAndPrint = (def) ->
      freshedType = freshenType type.type
      checkedType = (freshInstance ctx, def.type).type
      sub = mostGeneralUnifier checkedType, freshedType
      if isFailed sub
        score = -Infinity
      else
        score = -((subMagnitude checkedType, freshedType) + i * 100)
      type: plainPrettyPrint def.type#score + ' ' +

  removeFromMap topScope, 'is-null-or-undefined'
  addToMap topScope, '{}',
    type: quantifyAll toConstrained new TypeApp arrayType, (new TypeVariable 'a', star)
  # TODO: suggest function calls, possibly given prefix
  # addToMap topScope, '(sqrt )',
  #   type: quantifyAll toConstrained numType
  findMatchingDefinitionsOnType type, join scoped, [topScope]

findMatchingDefinitionsOnType = (type, definitionLists) ->
