[pulse] Don't print attribute ranks

Summary: Numeric attribute ranks are getting confused with addresses. Add an option (false by default) to MakePPUniqRankSet which prevents printing of the ranks.

Reviewed By: jvillard

Differential Revision: D17094269

fbshipit-source-id: 353c52fca
master
Ezgi Çiçek 6 years ago committed by Facebook Github Bot
parent 356ec9afe5
commit 28e84f275e

@ -233,7 +233,7 @@ module type PPUniqRankSet = sig
val union_prefer_left : t -> t -> t
val pp : F.formatter -> t -> unit
val pp : ?print_rank:bool -> F.formatter -> t -> unit
end
module MakePPUniqRankSet (Val : PrintableRankedType) : PPUniqRankSet with type elt = Val.t = struct
@ -273,7 +273,10 @@ module MakePPUniqRankSet (Val : PrintableRankedType) : PPUniqRankSet with type e
m
let pp = Map.pp
let pp ?(print_rank = false) fmt map =
if print_rank then Map.pp fmt map
else pp_collection ~pp_item:Val.pp fmt (Map.bindings map |> List.map ~f:snd)
let singleton value = add Map.empty value

@ -186,7 +186,7 @@ module type PPUniqRankSet = sig
(** in case an element with the same rank is present both in [lhs] and [rhs], keep the one from
[lhs] in [union_prefer_left lhs rhs] *)
val pp : F.formatter -> t -> unit
val pp : ?print_rank:bool -> F.formatter -> t -> unit
end
module MakePPUniqRankSet (Val : PrintableRankedType) : PPUniqRankSet with type elt = Val.t

Loading…
Cancel
Save