anchor.diff:        end
   
       | Abs(binders, body) ->
  +      let binders = binders |> List.map replace_unit_pattern in
         let _, ftv = List.fold_left (fun (env, ftvs) pat ->
           match pat.pat with
             | PatAscribed(_, t) -> env, free_type_vars env t@ftvs
  
positive.code:                                   then (Inr (qualify env id), [], None), def
                                    else (Inl id, [], None), def
                                  | _ -> raise (Error("Unexpected let binding", p.prange))
                        end) in
  
          let env', fnames, rec_bindings =
            List.fold_left (fun (env, fnames, rec_bindings) ((f, _, _), _) ->
              let env, lbname, rec_bindings = match f with
  
negative.code:     | Product(binders, t) -> uncurry (bs@binders) t
      | _ -> bs, t
  
  let rec is_var_pattern p = match p.pat with 
    | PatWild
    | PatTvar(_, _)
    | PatVar(_, _) -> true
    | PatAscribed(p, _) -> is_var_pattern p
    | _ -> false
  
  let rec is_app_pattern p = match p.pat with
    | PatAscribed(p,_) -> is_app_pattern p
    | PatApp({pat=PatVar _}, _) -> true
    | _ -> false
  
  let replace_unit_pattern p = match p.pat with 
    | PatConst Const.Const_unit -> 
      mk_pattern (PatAscribed (mk_pattern PatWild p.prange, unit_ty)) p.prange
    | _ -> p
      
  let rec destruct_app_pattern env is_top_level p = match p.pat with
    | PatAscribed(p,t) ->
      let (name, args, _) = destruct_app_pattern env is_top_level p in
  