Previous week Up Next week


Here is the latest Caml Weekly News, for the week of August 28 to September 04, 2012.

  1. xtmpl 0.2 and stog 0.2
  2. Mascot 1.0 release
  3. Kaputt 1.2 release
  4. JoCaml 4.00.0 release
  5. ocaml-lua v1.0: OCaml binding of Lua library
  6. PROMELA library 0.4
  7. ocaml-4.00.0 compilation problem with first class modules and optional parameters
  8. hevea 2.00
  9. Other Caml News

xtmpl 0.2 and stog 0.2


Maxence Guesdon announced:
I'm happy to announce Xtmpl 0.2 is available from
Xtmpl is a rewrite engine / templating library for Xml trees. This release
includes only minor changes.

I'm even happier to announce Stog 0.2, available from

Stog is a static multi-lingual web site and blog generator.
A lot of changes in this release, including: Processed files are now only
XML (no ad hoc format any more). The system is more flexible, more
convenient also. Documentation was updated accordingly.

Mascot 1.0 release


Xavier Clerc announced:
This post announces the 1.0 release of the Mascot project, whose goal is to
provide a style-checker for OCaml sources.

Home page:

Main changes since 1.0-beta:
- support for checks based on binary annotations
- support for binary output mode, and report-only mode
- new code check: 'catch_all' to detect patterns catching all
- new code check: 'code.ignore_unit' check to detect application of
'ignore' to expression whose type is 'unit'
- bug #72: allow punctuation after closing a block
- bug #74: handle the '::' operator
- bug #75: do not require whitespace after '?' used for optional label
- bug #76: do not require whitespace around '..' used for character
- bug #77: allow absence of whitespace before unary minus if previous
token is an opening one
- bug #79: treat '[< ... >]' and '[| ... |]' blocks like '{ ... }'
- bug #80: allow whitespace after '.' when used to introduce
polymorphic type
- bug #81: allow opening token after a label
- bug #84: use 'center' rather than 'p' tag with 'align' attribute,
and correct handling of icons
- bug #87: install shouldn't build anything
- bug #89: do not activate warnings by default
- bug #90: output available checks as a ready-to-use config
- bug #93: 'interface.duplicate' to detect duplicate entries in
- bug #94: do not require whitespace after colon
- bug #96: 'typography.trailing_white_space' now has a 'tolerance'
parameter in order to indicate how many whitespace characters may be
- update for OCaml 4.00.0

Kaputt 1.2 release


Xavier Clerc announced:
This post announces the 1.2 release of the Kaputt project, whose goal is to
provide a comprehensive testing framework for the OCaml language.

Home page:

Main changes since 1.1:
- new 'Mock' module providing means of recording calls made to a function
- support for specification of partial functions (i. e. raising exceptions)
- preprocessor allowing to store tests in separated '.mlt' files
- removed deprecated functions
- update for OCaml 4.00.0
- bug#85: cmi file is not installed
- bugfixes to bigarray and nums support

JoCaml 4.00.0 release


Luc Maranget announced:
It is my pleasure to announce the new release (4.00.0) of JoCaml.

JoCaml is the concurrrent and distributed extension of OCaml based upon
the join-caculus.

The new release follows OCaml evolution, it may be that the integration
of OCaml new features such as GADT and binary annotations is far
from perfect...

The new release is available from JoCaml web site:

ocaml-lua v1.0: OCaml binding of Lua library


Paolo Donadeo announced:
I'm happy to announce the first release of ocaml-lua, the OCaml
binding of the Lua library. With ocaml-lua you can embed a Lua
interpreter in an OCaml program in a few lines of code, and use Lua
for configuration or customization purposes.

Here are some references:

The homepage of the project is hosted on OCaml Forge:
The complete library reference (ocamldoc generated) is here:
Source tarballs are on the download page on OCaml Forge:
The official GIT repository is here:
Bug reports and feature requests are on my page on GitHub:

PROMELA library 0.4


Markus Weissmann announced:
I'd like to announce version 0.4 of the PROMELA library. It provides types
and functions to create, analyze and modify PROMELA programs as used by the
Spin model checker.
The source code is available on ocamlforge under the new bsd license:

The purpose of the library is to make automated generation, rewriting and
verification of PROMELA models easy. Think of it as something like "LLVM for
model checking".
It comes with an example generator that can create a model of an
arbitrary-sized dining philosophers problem.

ocaml-4.00.0 compilation problem with first class modules and optional parameters


Jacques-Pascal Deplaix asked and Jacques Garrigue explained:
> I have met some compilation problem when I tried to compile ocsimore
> with ocaml-4.00.0:
> Error: This expression has type
> ?href_action:Wiki_syntax_types.link_action ->
> ?link_action:Wiki_syntax_types.link_action ->
> Wiki_syntax_types.desugar_param -> string -> string Lwt.t
> but an expression was expected of type
> Wiki_syntax_types.desugar_param -> string -> string Lwt.t
> It's really a weird error. I tried to reproduce it in a small test-case
> but I didn't succeed.
> I made a patch for it in ocsimore, but it's really dirty/useless:
> If someone can tell me if it's an ocaml bug or something else.

OCaml 4.00 is much more agressive in propagating expected types when
typing expressions. Unfortunately, there was a conflict between this
upward propagation, and the somehow adhoc behaviour which removes
optional arguments from a function passed as argument to a function or
record/variant constructor not expecting optional arguments.

Specifically, this is this behavior:

val f : (unit -> unit) -> unit
val g : ?x:int -> ?y:bool -> unit -> unit

let () = f g

This code triggers automatic discarding of the optional arguments of g,
so that the type matches the expected one.

But for this we need to first infer the type of the argument, to see that
it doesn't match the expected one.

I was not aware that this feature was widely used, and the behavior in 4.00.0
is to restrict this feature to expressions where upward propagation doesn't
make sense anyway:
* identifiers
* function applications
* message sending
* record field extraction
* wrapping of "let open" around any of those

Since "let module" is not included, this breaks the code in ocsimore...

This is actually the same problem as reported in

The clean fix in your case is to move the "let module" outside of the

let module Plugin = (val p: WikiPlugin) in desugar_content (desugar_string

If you don't care about compatibility with 3.12, you can even write:

| WikiPlugin (module Plugin) ->
desugar_content (desugar_string Plugin.wikiparser)

I'm pondering what to do about this. Since this feature is described
in the tutorial part of the reference manual, I suppose this qualifies
as a bug. However, combining this behavior with upward propagation is

Not propagating types to function arguments seems fine, but for
variant and record constructors this is less clear-cut. Another option
is to extend the syntactic cases where the behavior is triggered,
including "let" and "let module", but the above PR#5748 is about
inlined functions, which could benefit from propagation.

hevea 2.00


Luc Maranget announced:
It is my pleasure to announce the new, 2.00 release of HEVEA.

HEVEA is a LaTeX to HTML translator. The input language is a
fairly complete subset of LaTeX2e and the output
language is HTML that is (hopefully) correct with respect to
version 5.

HEVEA web page is

This release is a major one as hevea output has changed from
HTML 4.00 (transitional) to HTML version 5.

Other Caml News

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

A safe but strange way of modifying OCaml compiler:

First release of OCaml binding of Lua library:

First release of OCaml binding of Lua library:


Kaputt 1.2:

JoCaml 4.00:

Mascot 1.0:

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