Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of November 04 to 11, 2014.

  1. testing platform
  2. OCaml opportunities in London
  3. Parsetree comparison
  4. New list for educators:
  5. Other OCaml News

testing platform


Roelof Wobben asked and Paolo Donadeo replied:
> Does Ocaml has a testing platform where I can write test like this way
> I can do in clojure:
> (facts "about `pr134`"
>   (fact "it normally return true if the key exist and the value is nil"
>     (pr134 :a {:a nil :b 2})  => true
>     (pr134 :b {:a nil :b 2})  => false
>     (pr134 :c {:a nil :b 2})  => false
>         ))

Did you considered qtest?
Milan Stanojević also replied:
There is also pa_ounit,

OCaml opportunities in London


Tony announced:
OCaml is a fantastic language with huge potential which is only unlocked by a
few London-based companies. I have a client which is exploring the application
of programming using OCaml in the development of algebra representation for
financial instruments. You will have the opportunity to introduce the language
and train others who have a passion for functional programming.

Unfortunately I have to limit the details I provide about this position via
email. However, anyone who is interested please do get in touch in reply to
this message and we can have an informal conversation to see if there is
interest in both sides.

An ideal candidate would have a background in good programming principles
(perhaps C or C++) but a desire to work in OCaml for the future. The salary
limit will be around £100,000.
Jeremy Yallop then suggested:
There's a dedicated mailing list for job-related postings:  It might be worth posting there as well.

Parsetree comparison


Christoph Höger asked and Gabriel Scherer replied:
> is there a way to compare two abstract syntax trees for equality
> without taking into account locations? Or rather a way to stratify the
> location information inside a parsetree? I want to unit-test a parser
> that invokes the OCaml parser itself.

The Ast_mapper module contributed by Alain Frisch to recent versions
of the OCaml distribution allows you to perform arbitrary
transformations from AST to AST in a convenient way. In particular,
you could implement a erase-all-locations pass by simply overloading
the "location" method (it uses object-oriented style for open
recursion) to always return a dummy value.
Rodolphe Lepigre also replied:
One quick, dirty and hackish way to do that is to use the -dparsetree option
to print the parse tree, use sed to remove position indication and the compare
files with diff...

I used that trick to compare the ast generated by an OCaml parser generated
using DeCaP (, and the ast generated by
other OCaml parsers.

Here is the script we used:

ocamlc -dparsetree                 $1 2> /tmp/$1.ocaml
ocamlc -dparsetree -pp ../pa_ocaml $1 2> /tmp/$1.pa_ocaml

cat /tmp/$1.ocaml    | sed -e 's/(.*\.ml\[.*\]\.\.\[.*\])\( ghost\)\?//' > /tmp/$1.ocaml.out
cat /tmp/$1.pa_ocaml | sed -e 's/(.*\.ml\[.*\]\.\.\[.*\])\( ghost\)\?//' > /tmp/$1.pa_ocaml.out

# diff -y /tmp/$1.ocaml.out /tmp/$1.pa_ocaml.out | less
diff $2 /tmp/$1.ocaml.out /tmp/$1.pa_ocaml.out

New list for educators:


Anil Madhavapeddy announced:
There have been several requests from professors who are teaching
OCaml in schools and universities to have a forum to discuss issues
relating to using OCaml in an educational context.

I have created the <> mailing list for this purpose:

    Web Archives:

There is an informal wiki that is gathering information for eventual
importing to here:
    (and the associated pull request:

If you would like to contribute, please free to join the list by
following the first link, or contribute pointers to useful teaching
resources at the wiki or site.  In particular, if you teach
a course and don't mind being publicly listed, adding yourself to the
index helps other people who are considering using OCaml.

As a reminder, anyone can request a mailing list on if
it is relevant to the OCaml language or ecosystem.  Just drop a line
to me or to <> for more information.

Other OCaml News

From the ocamlcore planet blog:
Thanks to Alp Mestan, we now include in the OCaml Weekly News the links to the
recent posts from the ocamlcore planet blog at


Full Time: Software Developer (Functional Programming) at Jane Street in New York, NY; London, UK; Hong Kong:

Senior Software Engineer at McGraw-Hill Education (Full-time):

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