Add ?size and ?random to Hashtbl.of_seq and related functions#2205
Add ?size and ?random to Hashtbl.of_seq and related functions#2205dra27 wants to merge 2 commits intoocaml:trunkfrom
Conversation
Add ?size to all hash table related of_seq functions, instead of hard-coding 16. All of_seq functions which wrap a create call which expose ?random now themselves have ?random.
|
Ping @alainfrisch on this old one |
|
See also #2236 which proposes to add an (Personally as I mentioned I think that the |
|
I agree, @gasche. The problem with the approach I put here is that this breaks: seq |> Hashtbl.of_seqI think it's better to document that (* with this PR:
seq |> Hashtbl.of_seq ~size:32 ~random:true
*)
seq |> Hashtbl.add_seq (Hashtbl.create ~random:true 32)I have one question before closing this. Given that #2236 is never going to land, should we:
|
|
There is a consensus against the change proposed in this PR, so closing.
I agree. (I would document this, but not deprecate the function). Anyone, please feel free to open a PR with this documentation improvement. |
Split off from #2202 - note that the implementation of
Hashtbl.MakeSeeded.of_seqis therefore wrong, but this would be corrected after #2202 is merged (if this GPR is accepted).