Previous week Up Next week

Hello

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

OCaml-MariaDB

Archive: https://sympa.inria.fr/sympa/arc/caml-list/2016-08/msg00100.html

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:

https://github.com/andrenth/ocaml-mariadb
http://opam.ocaml.org/packages/mariadb/
      

CPS converting existential data type

Archive: https://sympa.inria.fr/sympa/arc/caml-list/2016-08/msg00102.html

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 - https://gist.github.com/anonymous/57262e4e1009e658b97e8986a2d03d40 
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)
  end)

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

Archive: https://sympa.inria.fr/sympa/arc/caml-list/2016-08/msg00106.html

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:
http://le-gall.net/sylvain+violaine/blog/index.php?post/2016/08/22/Release-of-OASIS-0.4.6

Download here:
https://forge.ocamlcore.org/frs/?group_id=54&release_id=1223
      

Other OCaml News

From the ocamlcore planet blog:
Here are links from many OCaml blogs aggregated at OCaml Planet,
http://ocaml.org/community/planet/.

OASIS v0.4.7 release
 http://forge.ocamlcore.org/forum/forum.php?forum_id=938

Release of OASIS 0.4.7
 http://le-gall.net/sylvain+violaine/blog/index.php?post/2016/08/22/Release-of-OASIS-0.4.6
      

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