anchor.diff:        (if poly then "polymonadic subcomp"
          else "path in the effect lattice") in
   
  -  if exists_polymonadic_subcomp env m n |> is_some
  -  then raise_error (Errors.Fatal_PolymonadicBind_conflict, (err_msg true)) env.range
  -  else if join_opt env m n |> is_some
  -  then raise_error (Errors.Fatal_PolymonadicBind_conflict, (err_msg false)) env.range
  +  if exists_polymonadic_subcomp env m n |> is_some ||
  +     exists_polymonadic_subcomp env n m |> is_some
  +  then raise_error (Errors.Fatal_Effects_Ordering_Coherence, (err_msg true)) env.range
  +  else if monad_leq env m n |> is_some ||
  +          monad_leq env n m |> is_some
  +  then raise_error (Errors.Fatal_Effects_Ordering_Coherence, (err_msg false)) env.range
     else { env with
            effects = ({ env.effects with
                         polymonadic_subcomps = (m, n, ts)::env.effects.polymonadic_subcomps }) }
  
positive.code:        else "path in the effect lattice") in
  
    if exists_polymonadic_bind env m n |> is_some
    then raise_error (Errors.Fatal_PolymonadicBind_conflict, (err_msg true)) env.range
    else if join_opt env m n |> is_some
         && not (lid_equals m n)
    then raise_error (Errors.Fatal_PolymonadicBind_conflict, (err_msg false)) env.range
    else { env with
           effects = ({ env.effects with polymonadic_binds = (m, n, p, ty)::env.effects.polymonadic_binds }) }
  
  
negative.code:             begin match BU.is_some (find_edge order (k, ub)), BU.is_some (find_edge order (ub, k)) with
                    | true, true ->
                      if Ident.lid_equals k ub
                      then (Errors.log_issue Range.dummyRange (Errors.Warning_UpperBoundCandidateAlreadyVisited, "Looking multiple times at the same upper bound candidate") ; bopt)
                      else failwith "Found a cycle in the lattice"
                    | false, false ->
                      raise_error (Errors.Fatal_Effects_Ordering_Coherence, BU.format4
                        "Uncomparable upper bounds! i=%s, j=%s, k=%s, ub=%s\n"
                        (Ident.string_of_lid i)
                        (Ident.string_of_lid j)
                        (Ident.string_of_lid k)
                        (Ident.string_of_lid ub)) env.range
                            (* AR: 07/09: earlier we were returning bopt, not raising error with the following comment, should check *)
                            (* KM : This seems a little fishy since we could obtain as *)
                            (* a join an effect which might not be comparable with all *)
                            (* upper bounds (which means that the order of joins does matter) *)
  