The heap implementation in the OCaml manual, which was pointed to in the precedent thread, is quite compact.

Okasaki (eg. in its book "Purely functional data structure", but can probably be found in papers available on the net) has a "leftist heap" data structure that is also compact and, to my personal taste, easier to understand, get familiar with and remember than the usual heap implementation -- or more exotic heaps. I was once in a situation similar to yours and found that I could implement both his leftist heap and the red-black trees in around 15 minutes.

On Thu, Jun 30, 2011 at 7:13 PM, Andrew <newsgroups.fr@gmail.com> wrote:
Hi all,

Since the previous discussion regarding priority queues pretty much concluded that they weren't available in OCaml, could you point to the most compact implementation that you know of? I'm very likely to have to recode my own implementation in a time-restricted setting, so I'd love to hear about efficient-yet-easy/fast-to-implement options.

Thanks!

--
Caml-list mailing list.  Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs