anchor.diff:  
     let rec tryMatchIn formal actual v2ty =
       match (resolveTop v2ty formal, resolveTop v2ty actual) with
  -     | (Var fv, Var av) when fv = av ->
  +     | (Var' fv, Var' av) when fv = av ->
          Some v2ty
  -     | (Var v, ty) | (ty, Var v) when not (occurs v2ty v ty) ->
  +     | (Var' v, ty) | (ty, Var' v) when not (occurs v2ty v ty) ->
          Some (HashEqMap.add v ty v2ty)
  -     | (App (formal, pars), App (actual, args)) when formal = actual ->
  +     | (App' (formal, pars), App' (actual, args)) when formal = actual ->
          assert (pars.Length = args.Length)
          let rec loop i v2ty =
            if i < pars.Length then
  
positive.code:           else
              sprintf "%A%A" t tys
  
  module Ty =
    let rec ofType (t: Type) =
      if t.IsArray then
        App (Arr (t.GetArrayRank ()), [|ofType (t.GetElementType ())|])
      elif t.IsGenericParameter then
        Var t
      elif t.IsGenericType then
        App (Def (t.GetGenericTypeDefinition ()),
             t.GetGenericArguments () |> Array.map ofType)
      else
        App (Def t, [||])
  
    let toMonoType (tyOriginal: Ty<'any>) =
      let rec toMonoType ty : option<Type> =
        match ty with
         | Var _ ->
           None
         | App (Arr r, [|ty|]) ->
           toMonoType ty
           |> Option.map (fun t ->
              if r = 1
              then t.MakeArrayType ()
              else t.MakeArrayType r)
         | App (Arr _, _) -> failwithf "Bug: %A" ty
         | App (Def t, [||]) -> Some t
         | App (Def t, tys) ->
           tys
           |> Array.chooseAll toMonoType
           |> Option.map (fun tys -> t.MakeGenericType tys)
      toMonoType tyOriginal
  
  ////////////////////////////////////////////////////////////////////////////////
  
    let rec containsVars ty =
      match ty with
       | Var _ -> true
       | App (_, tys) -> Array.exists containsVars tys
  
    let rec resolveTop v2ty ty =
      match ty with
  
negative.code: type Ty<'v> =
    | Var of 'v
    | App of TyCon * array<Ty<'v>>
    | Mono of Type
    override t.ToString () =
      match t with
       | Mono t ->
         sprintf "%A" t
       | Var v -> sprintf "%A" v
       | App (Def tc, [||]) ->
         sprintf "%A" tc
  