anchor.diff:                  mk_vartype(if mem n ns then "?" + string n else "_")
               | Utv v -> mk_vartype v
               | Ptycon(con, args) -> Choice.get <| mk_type(con, map (type_of_pretype' ns) args)
  -        string_of_type << type_of_pretype' stvs
  +        fun pt ->
  +            try
  +                Choice.succeed <| string_of_type (type_of_pretype' stvs pt)
  +            with Failure s ->
  +                Choice.failwith s
   
       let string_of_preterm = 
           let rec untyped_t_of_pt = 
  
positive.code:             else 
                  tryfind (fun (_, (_, ty')) -> 
                          let ty' = pretype_instance ty'
                          Some <| cont(unify (Some ptm) env ty' ty)) maps
                  |> Option.getOrFailWith "tryfind"
          | _ -> failwith "resolve_interface: Unhandled case."
      (* ----------------------------------------------------------------------- *)
      (* Hence apply throughout a preterm.                                       *)
      (* ----------------------------------------------------------------------- *)
  
negative.code:         let ty = new_type_var()
          let ptm', _, env = 
              try 
                  Choice.get <| typify ty (ptm, venv, undefined)
              with
              | Failure msg as e ->
                  let msg = "typechecking error (initial type assignment): " + msg
  