Skip to content

Commit

Permalink
Add Univ_map.to_dyns
Browse files Browse the repository at this point in the history
Thanks to @jeremiedimino
#4881 (comment)

Signed-off-by: Shon Feder <[email protected]>
  • Loading branch information
shonfeder committed Sep 6, 2021
1 parent 8a23fbe commit dff2e8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions otherlibs/stdune-unstable/univ_map.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,9 @@ let to_dyn (t : t) =
|> List.map ~f:(fun (Binding.T (key, v)) ->
let (module K) = key in
(string K.name, K.to_dyn v)))

let to_dyns (t : t) =
Int.Map.values t
|> List.map ~f:(fun (Binding.T (key, v)) ->
let (module K) = key in
(K.name, K.to_dyn v))
3 changes: 3 additions & 0 deletions otherlibs/stdune-unstable/univ_map.mli
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ val singleton : 'a Key.t -> 'a -> t
val superpose : t -> t -> t

val to_dyn : t -> Dyn.t

(** [to_dyns m] is an assoc list pairing keys to (representations of) values *)
val to_dyns : t -> (string * Dyn.t) list

0 comments on commit dff2e8a

Please sign in to comment.