       s1 = matchType t1.types[0], t2.types[0]
       # log "after matching", s1
       # I will imply functional dependency of the form A a b c | a -> b c
-      s2 = mostGeneralUnifier (new Types (substituteList s1, t1.types[1...])), (new Types t2.types[1...])
+      # s2 = mostGeneralUnifier (new Types (substituteList s1, t1.types[1...])), (new Types t2.types[1...])
+      s2 = unifyImpliedParams (substitute s1, t1), t2
       s3 = mergeSubs s1, s2
       s3 or
         unifyFail t1, t2

  """
  """(get "c" (map (+ 1) {a: 3 b: 2 c: 4}))""", 5

  # The following doesn't work because the Collection type class specifies
  # that the constructor takes only one argument.
  #

entail = (ctx, constraints, constraint) ->
  for c in constraints
    for superClassConstraint in constraintsFromSuperClasses ctx, c
      # if typeEq superClassConstraint, constraint
      if (sub = constraintsEqual superClassConstraint, constraint)
        ctx.extendSubstitution sub
        return yes
  instanceContraints = constraintsFromInstance ctx, constraint
  if instanceContraints
    allMap ((c) -> entail ctx, constraints, c), instanceContraints
  else
    no

constraintsEqual = (c1, c2) ->
  c1.className is c2.className and
    (typeEq c1.types.types[0], c2.types.types[0]) and
      unifyImpliedParams c1.types, c2.types

constraintsFromSuperClasses = (ctx, constraint) ->
  {className, types} = constraint
