anchor.diff:                    (lbname, f_e, (t, ([], ([],expected_t))), false, e) in
   
             let check_lb env (nm, (lbname, f, (t, (targs, polytype)), add_unit, e)) =
  -              let env = List.fold_left (fun env a -> Env.extend_ty env a None) env targs in
  +              let env = List.fold_left (fun env (a, _) -> UEnv.extend_ty env a None) env targs in
                 let expected_t = if add_unit then MLTY_Fun(ml_unit_ty, E_PURE, snd polytype) else snd polytype in
  -              let e = check_exp env e f expected_t in
  +              let e, _ = check_term env e f expected_t in
                 f, {mllb_name=nm; mllb_tysc=Some polytype; mllb_add_unit=add_unit; mllb_def=e} in
   
            (*after the above definitions, here is the main code for extracting let expressions*)
  
positive.code:         let g, (p, whens) = extract_one_pat false g p in
          let when_clause = mk_when_clause whens in
          g, [(p, when_clause)] 
  
  let normalize_abs (t0:term) =
      let rec aux bs t =
          let t = SS.compress t in
          match t.n with
              | Tm_abs(bs', body, _) -> aux (bs@bs') body
              | _ ->
                let e' = U.unascribe t in
                if U.is_fun e'
                then aux bs e'
                else U.abs bs e' in
     aux [] t0
  
  let ffi_mltuple_mlp (n:int) : mlpath =
      let name = if (2<n && n<6) then ("mktuple"^(Util.string_of_int n)) else (if n=2 then "mkpair" else (failwith "NYI in runtime/allocator/camlstack.mli")) in
  
negative.code:         if b then
              match then_e, else_e with
                  | Some then_e, Some else_e ->
                      let then_mle, f_then, t_then = synth_term g then_e in
                      let else_mle, f_else, t_else = synth_term g else_e in
                      let t_branch, maybe_lift = 
                          if type_leq g t_then t_else  //the types agree except for effect labels
                          then t_else, no_lift 
  