Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Typing of the sequence operator (;)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin_jambon@e...>
Subject: Re: [Caml-list] Typing of the sequence operator (;)
On Fri, 11 Nov 2005, Lukasz Stafiniak wrote:

> Dear list,
> Why does the sequence operator (;) have type 'a -> 'b -> 'b and not
> unit -> 'a -> 'a? There is (ignore) for doing "these things"
> purposefully. The toplevel warning is very often mute. Together with
> labels, this is a source of bugs.

You can use the Camlp4 pa_ru.cmo module which adds type constraints in 
sequences, and is mentioned there:

So something like that should work:
   ocamlopt -pp 'camlp4o pa_ru.cmo'


Martin Jambon, PhD -