caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Announce: Stdcompat, a compatibility module for OCaml standard library
       [not found] <703910623.16955712.1510823518237.JavaMail.zimbra@inria.fr>
@ 2017-11-16  9:20 ` Thierry Martinez
  0 siblings, 0 replies; only message in thread
From: Thierry Martinez @ 2017-11-16  9:20 UTC (permalink / raw)
  To: caml-list

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-16  9:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <703910623.16955712.1510823518237.JavaMail.zimbra@inria.fr>
2017-11-16  9:20 ` [Caml-list] Announce: Stdcompat, a compatibility module for OCaml standard library Thierry Martinez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).