From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9A9ADBB81 for ; Fri, 11 Nov 2005 21:12:41 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jABKCfa3007887 for ; Fri, 11 Nov 2005 21:12:41 +0100 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA31753 for ; Fri, 11 Nov 2005 21:12:40 +0100 (MET) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id jABKCd60007884 for ; Fri, 11 Nov 2005 21:12:40 +0100 Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id E33E2CDD548; Fri, 11 Nov 2005 15:12:37 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Fri, 11 Nov 2005 15:12:37 -0500 X-Sasl-enc: XSRxbZ6gio/T2guNtK2CyIJVz0LH0UCFDQ7mIu4DD8Qc 1131739956 Received: from munge (burnham.ljcrf.edu [192.231.106.2]) by frontend2.messagingengine.com (Postfix) with ESMTP id 69BA45722D4; Fri, 11 Nov 2005 15:12:36 -0500 (EST) Date: Fri, 11 Nov 2005 12:12:27 -0800 (PST) From: Martin Jambon X-X-Sender: martin@munge To: Lukasz Stafiniak Cc: caml users Subject: Re: [Caml-list] Typing of the sequence operator (;) In-Reply-To: <4a708d20511111133q432e1e9co@mail.gmail.com> Message-ID: References: <4a708d20511111133q432e1e9co@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at nez-perce with ID 4374FB39.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 4374FB37.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 lukasz:01 toplevel:01 cmo:01 sequences:01 ocamlopt:01 -pp:01 cmo':01 2005,:98 wrote:01 typing:01 jambon:01 jambon:01 caml:02 constraints:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 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: http://caml.inria.fr/pub/docs/manual-camlp4/manual002.html So something like that should work: ocamlopt -pp 'camlp4o pa_ru.cmo' yourfile.ml Martin -- Martin Jambon, PhD - http://martin.jambon.free.fr