Previous week Up Next week


Here is the latest OCaml Weekly News, for the week of August 19 to 26, 2014.

  1. OPAM 1.2 public beta
  2. Commercial Users of Functional Programming at ICFP 2014, Gothenburg, Sep 4-6
  3. OCaml 4.02.0+rc1
  4. Feedback wanted about the OCaml windows installer
  5. Gg 0.9.0
  6. Vg 0.8.1
  7. React 1.2.0
  8. Locally abstract type with type parameters
  9. OCaml HTML parsing & manipulation
  10. Core Suite 111.28.00
  11. Other OCaml News

OPAM 1.2 public beta


Continuing the thread from last week, Anil Madhavapeddy annouced:
As a followup post, we've just put up a blog post describing the new OPAM 1.2 
pinning workflow. Feedback on this would be most welcome during the beta cycle.

Commercial Users of Functional Programming at ICFP 2014, Gothenburg, Sep 4-6


Michael Sperber announced:

Commercial Users of Functional Programming (CUFP) 2014 at ICFP 2014; 
Gothenburg, Sweden, Sep 4-6.



Functional programming has been at the forefront of a new generation 
of programming technologies: Companies employing functional 
programming use it to enable more effective, robust, and flexible 
software development. 

The annual CUFP workshop is designed to serve the growing community of 
commercial users of functional programming: Practitioners meet and 
collaborate; language designers and users can share ideas about the 
future of their languages; experts share their expertise on practical 
functional programming. 

CUFP 2014 begins with two days of tutorials by top-notch 
language experts including advanced tutorials on special topics,
followed by a day of talks about industrial applications of 
functional programming.

More information about CUFP 2014 is available on the CUFP web site at

Registration is available at:


T1: Programming with Dependent Types
Ulf Norell

T2: Haskell in the Real World
Stefan Wehr

T3: Intro to Elm: a field guide for functional front-end programming (Part 1)
Evan Czaplicki & Spiros Eliopoulos

T4: Elm-d3: Front-end Development without Frameworks (Part 2)
Spiros Eliopoulos

T5: Idris: Practical Software Verification with Dependent Types
Edwin Brady

T6: Lens
Edward Kmett


T7: Introduction to OCaml
Leo White & Jeremy Yallop

T8: Programming in Rust
Felix Klock & Lars Bergstrom

T9: Tinkering with the Raspberry Pi using Erlang
Torben Hoffmann

T10: Hands-on Functional Web Development in F# with WebSharper
Adam Granicz

T11: Batteries Included: Generative Programming with Scala and LMS
Tiark Rompf & Nada Amin

T12: Introduction to testing with QuickCheck
John Hughes


Keynote: Making Money From FP	
Joe Armstrong, Ericsson and Royal Institute of Technology in Stockholm

Functional Programming at Verizon OnCue	
Timothy Perrett, Verizon

Adopting Functional Programming with OCaml at Bloomberg LP	
Maxime Ransan, Bloomberg LP

MBrace: large-scale programming in F#	
Eirik Tsarpalis, Nessos

Probabilistic Synchronization of State Between Independent Nodes	
Erlend Hamberg

Towards "annex", a Fact Based Dependency System	
Mark Hibberd

Building data and time-series analytics tools for F#	
Tomas Petricek & Howard Mansell

Haskell in the Misson Control Domain	
Michael Oswald

Haskell tools for satellite operations	
Björn Buckwalter

F# For Fun and Games	
Anthony Brown

Some usages of functional programming for FO and quants	
Renaud Bechade

Reactive I/O with Scala, Akka, and Play	
Kenneth Owens, Comcast

If your server is a function, is your company a library?	
Andrew Cowie

OCaml 4.02.0+rc1


Damien Doligez annouced:
The release of OCaml version 4.02.0 is imminent.  We have
created a release candidate for your testing pleasure.  Please
download the sources, compile, install, and test your favourite
software with it.  Then let me know whether it works for you.

We want to know about any show-stopping bugs, especially in the
compilation and installation phases.

This release candidate is available as source code at this

Happy hacking,

-- Damien Doligez for the OCaml team.

Feedback wanted about the OCaml windows installer


Jonathan Protzenko announced:
Following Damien's announcement of a new rc-candidate, I set out to
refresh the OCaml installer for windows and realized that I could use
some feedback.

The installer currently distributes:
- ocaml, with native and bytecode compilers
- flexlink
- findlib
- "ocamlwin", the infamous windows top-level,
- camlp4
- labltk

Please note that this is not enough to compile native programs, as an
external assembly tool ("as") is required, so without any extras, the
user can only use the top-level, and perform byte-code
compilation. Please note that, even though labltk is distributed,
run-time support libraries are needed for tk programs to run.

The installer currently:
- offers the option of installing cygwin along with enough packages to
have a working toolchain, including the "as" tool;
- offers the option of downloading and setting up emacs, along with
the official caml-mode, and setting up the right file associations (ml
and mli) in the windows explorer;
- offers the option of downloading activetcl to make sure tools such
as ocamlbrowser and the labltk libraries work properly.

I am considering:
- dropping "ocamlwin": it is old, buggy, and better replacements are
now available;
- optionally installing OCamlTop to provide a much-needed replacement
for "ocamlwin";
- dropping labltk along with the option for downloading activetcl:
this requires extra effort on my side because it now is distributed as
a separate project, and I suspect people who are serious about user
interfaces are using lablgtk, but I'd be interested in hearing your
opinion about this;
- keeping camlp4 even though it moved off into a separate project
- refreshing emacs to the latest version
- bundling Merlin binaries so that they can be installed along with
Emacs, if the user is so inclined.

I don't have a good understanding of the current user base of the
installer; so if you're a user of this installer, I'd be interested in
hearing your story. Is a good top-level important because you're in
education? Have you ever used labltk? Are you proficient enough to
download, say, odb (which, last time I checked, more or less worked on
Windows), and install the missing packages yourself?

Gg 0.9.0


Daniel Bünzli announced:
I'd like to announce the release of Gg 0.9.0 which should be available
shortly in opam.

There are a few renamings regarding matrices; sorry about the
inconvenience but the current scheme was a little bit confusing and
inconvenient when one decided to switch code to a matrix of higher
dimensionality. There are also other changes and additions, get all
the details in the release notes:

Gg is an OCaml module providing basic types for computer graphics and

Home page:

Vg 0.8.1


Daniel Bünzli announced:
I'd like to announce the release of Vg 0.8.1 which should be available
shortly in opam.

The details are in the release notes:

Vg is a library for declarative 2D vector graphics. 

Home page:

React 1.2.0


Daniel Bünzli announced:
I'd like to announce the release of React 1.2.0 which should be
available shortly in opam.

The details are in the release notes:

React is a module for functional reactive programming. 

Home page:

Locally abstract type with type parameters


Dario Teixeira asked:
Consider the signature LOGGER below, to be implemented by any module that
supposedly logs something wrapped under a custom monad:

  module type LOGGER =
      module Monad:
          type 'a t
          val return: 'a -> 'a t
          val bind: 'a t -> ('a -> 'b t) -> 'b t

      val log: unit -> unit Monad.t

We now define a functor that takes a LOGGER and defines a 'process' function
that operates under the monad.  But here's the twist: suppose that the function
that actually does the processing is defined elsewhere, in a module 'Foo'.
Moreover, instead of passing it the functions of the logger as independent
parameters, we deem it more convenient to pass the logger as a first-class

  module Make (Logger: LOGGER) =
      let process x = Foo.actually_process (module Logger: LOGGER) x

To avoid type-escaping-its-scope errors, we need to define a locally abstract
type in the implementation of 'actually_process'.  Something like this:

  let actually_process (type u) (module Logger: LOGGER with type 'a Monad.t = 'a u) x =
      let open Logger in
      let (>>=) t f = Monad.bind t f in
      Logger.log () >>= fun () ->
      Monad.return x

Which does not actually compile.  Is it at all possible to use a locally
abstract type when that type has type parameters?  And is there a solution
to this problem that does not require a) moving the implementation of
'actually_process' to the inside of a functor, or b) pass each function
of the first-class module as a separate parameter to 'actually_process'?
John F. Carr replied:
I hit the same limitation last year:

The inability to constrain parameterized types in packed module
types is a documented restriction.  You will have to ask the type
theory experts whether it is a necessary restriction.

A followup message offered a workaround for some cases.
Benjamin Greenman then added:
I agree with the solution in the second link: if you want a certain
condition to hold on the parameter, it needs to be made explicit. As
for whether this restriction is necessary, I believe it is because I
don't see any way of deciding the question 'a Monad.t = 'a u without
examining the abstract type hidden in a particular Logger.

What if you made LOGGER a functor parameterized on a Monad?
Leo White replied to the original post:
> To avoid type-escaping-its-scope errors, we need to define a locally abstract
> type in the implementation of 'actually_process'. Something like this:
>   let actually_process (type u) (module Logger: LOGGER with type 'a Monad.t = 'a u) x =
>       let open Logger in
>       let (>>=) t f = Monad.bind t f in
>       Logger.log () >>= fun () ->
>       Monad.return x

This function relies on higher-kinded polymorphism (i.e. it is
polymorphic in type `u` which has type parameters). Since OCaml's core
language does not provide direct support for higher-kinded polymorphism
the usual solution is to make `actually_process` into a functor. A
possible alternative solution, which may suit your use case, is outlined
in the paper "Lightweight higher-kinded polymorphism" [1] using the
"higher" library available on OPAM.



[1] Lightweight higher-kinded polymorphism
    Jeremy Yallop and Leo White   FLOPS 2014

OCaml HTML parsing & manipulation


Andrew Herron replied to this old thread:
I did an evaluation of HTML parsers back in February. Most of the
options are XML parsers, and a lot of them are very old. Other than
Nethtml, I came up with two alternatives to consider:

I didn't end up spending much time on either. It quickly became clear
that Nethtml was what I needed. It handles content that isn't strictly
valid, which was important to me, and has good performance.

Core Suite 111.28.00


Ben Millwood announced:
I am delighted to announce the 111.28.00 release of the Core suite.

The following packages were upgraded:

- async
- async_extended
- async_extra
- async_find
- async_inotify
- async_kernel
- async_parallel
- async_unix
- bignum
- core
- core_bench
- core_extended
- core_kernel
- jenga
- ocaml_plugin
- pa_bench
- pa_ounit
- patdiff
- patience_diff
- textutils

Files and documentation for this release are available on our website
and all packages are in opam:

The changelog for all Core packages across all versions can be found at:

Here is the list of changes for this version:

## 111.28.00

### async_extra

- Added to `Versioned_rpc` a non-functor interface.
- Added `Log.level`, which returns the last level passed to `set_level`.
- Enabled Async-RPC pushback in the `Tcp_file` protocol.

### async_unix

- Added `Shutdown.set_default_force`, which allows one to change the
  default `force` value used by `shutdown`.

    This is useful for applications that call `shutdown` indirectly.

        val set_default_force : (unit -> unit Deferred.t) -> unit

### core

- Added `Piecewise_linear.create_from_linear_combination`.

        val create_from_linear_combination : (t * float) list -> t Or_error.t

- Added `Time.is_{earlier,later} : Time.t -> than:Time.t -> bool`, which
  are easier to read than `Time.(<)` and friends.
- Added `Command.exec`, which allows one to include the `Command`
  hierarchy from one executable in another.

    `Command.exec` takes the file path to an executable that uses the
    `Command` module and returns a `Command.t` that integrates the
    executable (by exec'ing it), including providing recursive help and
    autocompletion as if it were a standard `Command.t`.

- Replaced most uses of `Hashtbl.replace` with `Hashtbl.set`.
- Renamed `Float.epsilon` to `robust_comparison_tolerance`, to avoid
  confusion with `epsilon_float`.

### core_extended

- Implemented `Int.gcd` using binary GCD in C, for improved performance.
- Added `Bin_io_utils.Serialized`, which stores a value in memory as its
  bin-io representation.

    Writing such a value just blits the value.
- Moved `Text_block` from `Core_extended` into `Textutils`.
- Added modules `Hashtbl2` and `Hashtbl2_pair`.

### core_kernel

- Added `Pooled_hashtbl.resize` function, to allow preallocating a table
  of the desired size, to avoid growth at an undesirable time.
- Added `Pooled_hashtbl.on_grow` callback, to get information about
  hashtbl growth.
- Changed `Hashable.Make` to not export a `Hashable` module.

    The `Hashable` module previously exported was useless, and shadowed

- Moved `Common.does_raise` to `Exn.does_raise`, to make it easier to
- Added ``, `minus_one`, and `~-`.  (fixes #12).
- Removed `Core.Std.unimplemented` and renamed it as

    It is not used enough to live in the global namespace.

### jenga

- Fixed problem that caused `rule failed to generate targets`.

### ocaml_plugin

- Fixed a bug in tests that could leave the repository in a state where
  running the tests would fail.

    The bug happened if the tests were interrupted after creating
    read-only directories but before cleaning then up.

### pa_ounit

- Added a flag to disable embedding of unit tests/inline benchmarks.

### textutils

- Moved `Text_block` from `Core_extended` into `Textutils`.


We hope you find it useful!

-- Ben Millwood, on behalf of the Core team.

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

Terms With Variables (C++):

OCaml EFL 1.11.0 released:

Clearly Failing:

Turn your editor into a full fledged OCaml IDE:

OCaml 4.02.0 / release candidate 1:

Announcing Camlhighlight 3.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