 constraintsFromInstance = (ctx, constraint) ->
   {className, type} = constraint
   for instance in (ctx.classNamed className).instances
+    # log "trying to find the instance", (printType instance.type.type), (printType constraint)
     substitution = toMatchTypes instance.type.type.types, constraint.types
     if substitution
+      ctx.extendSubstitution substitution
       return map ((c) -> substitute substitution, c), instance.type.constraints
   null
 

  'functional deps'
  """
    Collection (class [ce e]
      (# (| ce: e))
      first (fn [in]
        (: (Fn ce e))))


  undefined

typeNamesOfNormalized = (constraint) ->
  #map (({name}) -> name), constraint.types.types
  [constraint.types.types[0].name]

accessList = (what, list) ->
  [first, rest...] = list
