Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of June 05 to 12, 2018.

  1. XPath implementation or equivalent
  2. Uucd, Uucp, Uunf and Uuseg for Unicode 11.0.0
  3. Tools for logic programming in OCaml
  4. Ocaml under the hood
  5. Other OCaml News

XPath implementation or equivalent


Julien Tesson asked and Alain Frisch replied:
> Is anyone aware of an Ocaml implementation of Xpath or any similar tool to
> query an XML document ?
> I found XML parsers via Opam, like pxp, but they don't seem to come with a
> querying library.

You might have a look at , which implements a
naive XPath evaluator (written 18 years ago, and never used for anything
also refers to an XPath evaluator in PXP.
Richard Jones also replied:
Yes we use libxml2 extensively in virt-v2v through some very simple
bindings (not packaged separately, but they are rather trivial).

Example usage:


I would relicense these as LGPLv2+ if you wanted that (but to save
time don't bother asking me to relicense them as MIT or whatever so
you can steal the work from the commons).
Richard Jones later added:

Oops, missed out the Xpath_helpers module which is in a
different directory:

Uucd, Uucp, Uunf and Uuseg for Unicode 11.0.0


Daniel Bünzli announced:
Unicode 11.0.0 was released yesterday. It adds 684 new characters to
the standard including the COPYLEFT SYMBOL (U+1F12F) character. See
[here][0] for details about the additions.

Accordingly the libraries mentioned at the end of this message had to
be updated, consult the individual release notes for details. Both
Uucd and Uucp are incompatible releases sinces new script and block
enumerants had to be added.

If Unicode still puzzles you, have a look at Uucp’s absolute minimal
Unicode [introduction][1] and a few [biased tips][2] to handle Unicode
in OCaml.

Best and happy copylefting,


# Uucd 11.0.0 Unicode character database decoder for OCaml.

# Uucp 11.0.0 Unicode character properties for OCaml.

# Uunf 11.0.0 Unicode text normalization for OCaml.

# Uuseg 11.0.0 Unicode text segmentation for OCaml.


Tools for logic programming in OCaml


Volodymyr Melnyk asked and Darius replied:
> I have no experience with logic programming (LP) and I have no time and reason
> to learn Prolog or other language that are canonical in the area of LP. By the
> way I'm very interested in the topic of LP and related paradigms. Could you
> please mention some OCaml libraries for logic programming and related things?

Check out It's based on the LogicT
library/paper (worth a read), which is closely related to miniKanren. The ideas
are similar in that you construct nondeterministic programs by manipulating
streams of solutions.

Ocaml under the hood


Slavik Loginov asked and Ivan Gotovchits replied:
> Where I can find some information on memory representation of objects in OCaml?

This [blog post][1] is rather thorough and an interesting reading. I do remember
there was some other good source also, but can't remember where.


Other OCaml News

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

Bucket Sort

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