I am new to OCaml, and curious if there is a (standardish) data structure in OCaml equivalent to
http://hackage.haskell.org/package/containers-0.2.0.1/docs/Data-Sequence.html
which provides O(1) prepend and append operations?
I believe this is commonly called a deque.
Here's an implementation in OCaml Batteries Included:
http://ocaml-batteries-team.github.io/batteries-included/hdoc/BatDeque.html
This looks like something similar in Jane Street Core:
https://ocaml.janestreet.com/ocaml-core/111.17.00/doc/core/#Dequeue
These are (I would claim) the two most widely used basic OCaml libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With