anchor.diff:  
     let r = Env.get_range env in
   
  -  let effect_args_from_repr (repr:term) (is_layered:bool) : list<term> =
  -    let err () =
  -      raise_error (Errors.Fatal_UnexpectedEffect,
  -        BU.format2 "Could not get effect args from repr %s with is_layered %s"
  -          (Print.term_to_string repr) (string_of_bool is_layered)) r in
  -    let repr = SS.compress repr in
  -    if is_layered
  -    then match repr.n with
  -         | Tm_app (_, _::is) -> is |> List.map fst
  -         | _ -> err ()
  -    else match repr.n with 
  -         | Tm_arrow (_, c) -> c |> U.comp_to_comp_typ |> (fun ct -> ct.effect_args |> List.map fst)
  -         | _ -> err () in
  -    
  -
     let ct = U.comp_to_comp_typ c in
   
     let u, a, c_is = List.hd ct.comp_univs, ct.result_typ, ct.effect_args |> List.map fst in
  
positive.code:  *                            these are done in an env with b, and the returned guard is closed over b)
   * and return k_i as the output indices
   *)
  let mk_layered_bind env (m:lident) (ct1:comp_typ) (b:option<bv>) (ct2:comp_typ) (flags:list<cflag>) (r1:Range.range) : comp * guard_t =
    if Env.debug env <| Options.Other "LayeredEffects" then
      BU.print2 "Binding c1:%s and c2:%s {\n"
        (Print.comp_to_string (S.mk_Comp ct1)) (Print.comp_to_string (S.mk_Comp ct2));
  
    let ed = Env.get_effect_decl env m in
  
    let u1, t1, is1 = List.hd ct1.comp_univs, ct1.result_typ, List.map fst ct1.effect_args in
    let u2, t2, is2 = List.hd ct2.comp_univs, ct2.result_typ, List.map fst ct2.effect_args in
  
    let _, bind_t = Env.inst_tscheme_with (ed |> U.get_bind_vc_combinator) [u1; u2] in
  
    let bind_t_shape_error (s:string) =
      (Errors.Fatal_UnexpectedEffect, BU.format2
  
negative.code: 
    let guard_f =
      let f_sort = (fst f_b).sort |> SS.subst substs |> SS.compress in
      let f_sort_is = effect_args_from_repr f_sort (Env.is_layered_effect env ct.effect_name) r in
      List.fold_left2
        (fun g i1 i2 -> Env.conj_guard g (Rel.teq env i1 i2))
        Env.trivial_guard c_is f_sort_is in
  
    let is = effect_args_from_repr lift_ct.result_typ (Env.is_layered_effect env tgt) r in
  
    let c = mk_Comp ({
      comp_univs = lift_ct.comp_univs;  //AR: TODO: not too sure about this
  