Skip to content

Commit

Permalink
do not use exposed type in meta map
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Feb 24, 2024
1 parent c29900d commit 7197950
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/meta_map.ourown.ml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ let remove (type a) (k : a Key.t) t =

let cardinal t = M.cardinal t
let length = cardinal
let iter f t = M.iter (fun _ p -> f (pair_of_e_pair p)) t
let to_list t = M.fold (fun _ p l -> pair_of_e_pair p :: l) t []
let add_list t l = List.fold_right add_pair_ l t
let of_list l = add_list empty l
let iter f (self : t) = M.iter (fun _ p -> f (pair_of_e_pair p)) self

let to_list (self : t) : binding list =
M.fold (fun _ p l -> pair_of_e_pair p :: l) self []

let add_list (self : t) l = List.fold_right add_pair_ l self

0 comments on commit 7197950

Please sign in to comment.