# Interest in a (mutable) binomial heap in Stdlib

**URL:** <https://discuss.ocaml.org/t/interest-in-a-mutable-binomial-heap-in-stdlib/14665>\
**Category:** Ecosystem\
**Tags:** stdlib\
**Created:** [May 20, 2024, 5:50am UTC](https://discuss.ocaml.org/t/interest-in-a-mutable-binomial-heap-in-stdlib/14665 "2024-05-20T05:50:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jake-87](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jake-87/32/5301_2.png) [@jake-87](https://discuss.ocaml.org/u/jake-87)\
**Post date:** [May 20, 2024, 5:50am UTC](https://discuss.ocaml.org/t/interest-in-a-mutable-binomial-heap-in-stdlib/14665/1 "2024-05-20T05:50:06Z")

</div>

IMO it’d be fairly useful - batteries has one, but they’re inductive, not array-backed, and immutable. There’s precedent for large-storage datastructures in Hashtbl, which I feel is “morally” similar.  
They wouldn’t be a pain to implement, but like Hashtbl, it’s slightly more then you’d want to do in every project, and they’re pretty applicable to a lot of tasks (especially with the new features from 5.0).

There’s an implementation of a heap in the examples for Dynarray, that if extended with a set of useful functions (like what’s been done with Hashtbl) would be suitable, I would think.

Opinions?

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [May 20, 2024, 6:35am UTC](https://discuss.ocaml.org/t/interest-in-a-mutable-binomial-heap-in-stdlib/14665/2 "2024-05-20T06:35:52Z")

</div>

[Stdlib priority queues by backtracking · Pull Request #12871 · ocaml/ocaml · GitHub](https://github.com/ocaml/ocaml/pull/12871) 🙂

Cheers,  
Nicolas

---

<div class="post-metadata">

**Author:** ![jake-87](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/jake-87/32/5301_2.png) [@jake-87](https://discuss.ocaml.org/u/jake-87)\
**Post date:** [May 20, 2024, 10:20pm UTC](https://discuss.ocaml.org/t/interest-in-a-mutable-binomial-heap-in-stdlib/14665/3 "2024-05-20T22:20:53Z")

</div>

Apologies, I did do a search but must have missed searching for a priority queue as opposed to a heap.  
Good to know that it’s not a bad idea, I suppose 😄
