Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of August 16 to 23, 2016.

  1. OCaml-MariaDB
  2. CPS converting existential data type
  3. OASIS v0.4.7
  4. Other OCaml News



Andre Nathan announced:
I'm happy to announce the release of OCaml-MariaDB, which are
Ctypes-based bindings to MariaDB's version of libmysqlclient.

MariaDB's version of the library is compatible with MySQL's but also
includes a nonblocking API that makes it more suitable for use with
OCaml's concurrency libraries such as Lwt or Async.

The code and issue tracker are on Github and the package is available
via OPAM:

CPS converting existential data type


Alexey Egorov asked:
in haskell it's possible to convert some data type to it CPS'ed form using
rank-N polymorphism.

I'm trying to do the same in ocaml using objects with polymorphic methods
(instead of GHC RankNTypes extension), and it works well unless I'm using data
type with existential type variables.

Example - 
Haskell version compiles, while ocaml version gives type error about universal
variable escaping it's scope.

What is the right way to do this? Is it possible at all?
Jacques Garrigue replied:
The problem is that type annotations are not propagated to the body of objects,
so you need to annotate the method explicitly, or to annotate the type of self.
The following annotated version works:

let uncps : type a . a cps_t -> a t =
  fun p -> p # get Nil (object
    method get : 'e . (a, 'e) d -> ('e -> a) -> a t = fun d f -> Cons (d, f)

Thank you for this interesting example.
Stephen Dolan:
Incidentally, you can do it quite neatly by using polymorphic records instead of
polymorphic objects:

type ('a,'r) uncons = { cons : 'e . ('a, 'e) d -> ('e -> 'a) -> 'r }
type 'a cps_t = { runCps : 'r . 'r -> ('a, 'r) uncons -> 'r }

let uncps {runCps} = runCps Nil {cons = fun d f -> Cons(d, f)}

OASIS v0.4.7


Sylvain Le Gall announced:
I have just released OASIS 0.4.7.

OASIS is a tool to help OCaml developers to integrate configure, build and
install systems in their projects. It should help to create standard entry
points in the source code build system, allowing external tools to analyse
projects easily.

Important changes:
* Drop support for OASISFormat 0.2 and 0.1.
* New plugin "omake" to support build, doc and install actions.
* Improve automatic tests (Travis CI and AppVeyor)
* Trim down the dependencies (removed ocaml-gettext, camlp4, ocaml-data-notation)

New features:
* findlib_directory (beta): to install libraries in sub-directories of findlib.
* findlib_extra_files (beta): to install extra files with ocamlfind.
* source_patterns (alpha): to provide module to source file mapping.

Full blog post:

Download here:

Other OCaml News

From the ocamlcore planet blog:
Here are links from many OCaml blogs aggregated at OCaml Planet,

OASIS v0.4.7 release

Release of OASIS 0.4.7

Old cwn

If you happen to miss a CWN, you can send me a message and I'll mail it to you, or go take a look at the archive or the RSS feed of the archives.

If you also wish to receive it every week by mail, you may subscribe online.

Alan Schmitt