anchor.diff:                           vars))
                      (HashEqMap.empty, [])
                  |> fun (apps, vars) ->
  -                  // Classify types that had a type variable at the
  -                  // classification position using the remaining positions.
                     let vars = build' ats vars
  -
  -                  // Were some types classified distinct from others at the
  -                  // position `at`?
                     if HashEqMap.isEmpty apps then
  -                    // No, just produce whatever we get from classifying the
  -                    // types that had a variable at the examined position.
                       force vars
                     else
  -                    // Yes, so we produce a branch node.
                       (at,
                        apps
                        |> HashEqMap.map
                            (fun (n, tyds) ->
  -                            // Add the new positions in these types to the
  -                            // sequence of positions to classify types against.
                               let ats = List.init n (fun i -> i::at) @ ats
                               build' ats tyds),
                        vars) |> Branch
   
  -  /// Builds a type tree corresponding to the given association sequence.
     let build tyrs = build' [[]] (List.ofSeq tyrs)
   
  -  /// Returns a sequence values from the type tree whose associated types may
  -  /// unify with the given type.
     let rec filter (formal: TyTree<'r>) (actual: Ty<_>) : seq<'r> = seq {
       match force formal with
        | Empty -> ()
        | One r -> yield r
        | Many rs -> yield! rs
        | Branch (at, apps, vars) ->
  -       // Does the `actual` type have some non-var type at the branch position?
          match getAt at actual with
           | None | Some (Var _) ->
  -          // No, so we can't filter out `apps` types at this branch.
             yield! HashEqMap.toSeq apps
                    |> Seq.collect (fun (_, formal) ->
                       filter formal actual)
           | Some (App (tc, _)) ->
  -          // Yes, so we need only produce those `apps` that have the same tycon.
             match HashEqMap.tryFind tc apps with
              | None -> ()
              | Some formal ->
                yield! filter formal actual
  -       // We also need to produce the `vars` types.
          yield! filter vars actual
     }
  
positive.code: /// `T<A, U<[B]>>`.
  type TyCursor = list<int>
  
  /// Represents a mapping of types to values of type `'r` such that given a type,
  /// the type value pairs of the mapping can be filtered based on the given type
  /// and produced in an order from more specific to less specific types with
  /// respect to unification.
  type TyTree<'r> = Lazy<TyTreeFun<'r>>
  and TyTreeFun<'r> =
    | Empty
  
negative.code:             sprintf "%A%A" t tys
  
  module Ty =
    let rec ofType (t: Type) =
      if t.IsArray then
        App (Arr (t.GetArrayRank ()), [|ofType (t.GetElementType ())|])
  