From: Thierry Martinez <thierry.martinez@inria.fr>
To: caml-list@inria.fr
Subject: [Caml-list] Announce: Stdcompat, a compatibility module for OCaml standard library
Date: Thu, 16 Nov 2017 10:20:15 +0100 (CET) [thread overview]
Message-ID: <1771189138.16960833.1510824015146.JavaMail.zimbra@inria.fr> (raw)
In-Reply-To: <703910623.16955712.1510823518237.JavaMail.zimbra@inria.fr>
Hi, everybody!
I am pleased to announce Stdcompat: a compatibility module for OCaml
standard library.
Stdcompat.* redefines (most of the) symbols available in the standard
library of OCaml 4.06.0, such as List.find_opt, floatarray, Uchar.t,
etc., and compiles on all versions of OCaml since 3.12.0.
If the version of OCaml is recent enough, these types and values are
just aliases to the corresponding symbols of the standard library,
Otherwise, they are redefined. For instance, Stdcompat.floatarray is
an alias for floatarray with OCaml 4.06.0 and for float array with
OCaml 4.05.0 and older.
Sub-modules signatures include the signatures of the standard library
modules, in order to allow Stdcompat to be opened globally if
preferred. For instance, Stdcompat.List reexports all the symbols of
List. See the .mlip file or the preprocessed .mli and the generated
documentation for the complete list of available symbols.
The provided redefinitions do not make anything magic with the
internal data structures: some of them are not as efficient as the one
of the standard library (for instance, Hashtbl.filter_map_inplace),
and can be even insecure (for instance, seeds are ignored for hash
tables prior OCaml 4.00). This is a design choice that can possibly
change in the future. Of course, these lesser redefinitions are used
only if the OCaml version is not recent enough.
The module is intended to follow future changes of the standard
library, and the API can change, for instance if some symbols become
deprecated. However, I will try to keep the ability to be compiled on
old versions of OCaml (at least 3.12.0).
GitHub repository: https://github.com/thierry-martinez/stdcompat
Available in OPAM: opam install stdcompat
Happy hacking!
--
Thierry.
parent reply other threads:[~2017-11-16 9:20 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <703910623.16955712.1510823518237.JavaMail.zimbra@inria.fr>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1771189138.16960833.1510824015146.JavaMail.zimbra@inria.fr \
--to=thierry.martinez@inria.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox