anchor.diff:                      (N.comp_to_string env c);
     c
   
  -
   (* private *)
  +
  +
  +let effect_args_from_repr (repr:term) (is_layered:bool) (r:Range.range) : 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 ()
   
   
   (*
  
positive.code: 
    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
  
negative.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_indexed_bind env
    (m n p:lident) (bind_t:tscheme)
    (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 m_ed, n_ed, p_ed = Env.get_effect_decl env m, Env.get_effect_decl env n, Env.get_effect_decl env p 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 bind_t [u1; u2] in
  
    let bind_t_shape_error (s:string) =
      (Errors.Fatal_UnexpectedEffect, BU.format2
  