 # Returns deferred and retained constraints
 deferConstraints = (ctx, constraints) ->
   reducedConstraints = reduceConstraints ctx, constraints
-  throw new Error "could not reduce constraints in deferConstraints" unless reducedConstraints
+  if not reducedConstraints.success
+    return reducedConstraints
   fixedVars = ctx.allBoundTypeVariables()
-  impliedConstraints = substituteList ctx.substitution, reducedConstraints
+  impliedConstraints = substituteList ctx.substitution, reducedConstraints.success
   isFixed = (constraint) ->
     # log fixedVars, (printType constraint), (findUnconstrained constraint)
     isSubset fixedVars, (findUnconstrained constraint)
   [deferred, retained] = partition isFixed, impliedConstraints
   # TODO: handle ambiguity when reducedConstraints include variables not in
   # fixedVars or quantifiedVars
-  [deferred, retained]
+  success: [deferred, retained]
 
 reduceConstraints = (ctx, constraints) ->
   normalized = normalizeConstraints ctx, constraints
-  if normalized
-    simplifyConstraints ctx, normalized
-  else
-    null
+  if normalized.success
+    simplifyConstraints ctx, normalized.success
+  else
+    normalized
 
 # Normalized constraints have a type variable in their head, they are "abstract"
 # and don't match any one instance

        toNormalize.push instanceContraints...
      else
        # TODO: propogate this as standard error
        throw new Error "no instance found to satisfy #{safePrintType constraint}"
      after = subLimit ctx.substitution
      # There was a functional dependency, renormalize
      if after isnt before
        toNormalize.push normalized...
        normalized = []
  if all normalized
    normalized
  else
    null

# normalizeConstraint = (ctx, constraint) ->
#   if isNormalizedConstraint constraint

  for constraint, i in constraints
    if not entailedBySuperClasses ctx, (join requiredConstraints, constraints[i + 1..]), constraint
      requiredConstraints.push constraint
  success: requiredConstraints


# Whether constraints entail constraint
