anchor.diff:  
     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) 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) 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
  
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:                     (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 ()
  
  
  (*
  