From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA30812; Fri, 25 Jan 2002 09:52:47 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA31846 for caml-list@pauillac.inria.fr; Fri, 25 Jan 2002 09:52:47 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA22418 for ; Thu, 24 Jan 2002 18:20:49 +0100 (MET) Received: from julie.univ-savoie.fr (univax.univ-savoie.fr [193.48.120.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g0OHKl517908; Thu, 24 Jan 2002 18:20:47 +0100 (MET) Received: from post.bourget.univ-savoie.fr (post.bourget.univ-savoie.fr [193.48.120.73]) by julie.univ-savoie.fr (8.9.3/jtpda-5.3.3) with ESMTP id SAA10419 ; Thu, 24 Jan 2002 18:20:37 +0100 (CET) Received: from univ-savoie.fr (www.lama.univ-savoie.fr [193.48.123.134]) by post.bourget.univ-savoie.fr (8.12.0.Beta7/jtpda-5.4) with ESMTP id g0OHKWWX002990 ; Thu, 24 Jan 2002 18:20:32 +0100 Message-ID: <3C504266.907EE3EA@univ-savoie.fr> Date: Thu, 24 Jan 2002 18:20:38 +0100 From: Christophe Raffalli X-Mailer: Mozilla 4.77 [fr] (X11; U; Linux 2.2.16-9mdksmp i686) X-Accept-Language: en MIME-Version: 1.0 To: Daniel de Rauglaudre , caml-list@inria.fr Subject: Re: [Caml-list] Re: about toplevels References: <4.3.2.7.2.20020122124034.026d1750@arda.pair.com> <20020121224336.GA17642@fichte.ai.univie.ac.at> <1011655678.3c4ca3fe74235@webmail.sbdconsultors.com> <20020121224336.GA17642@fichte.ai.univie.ac.at> <4.3.2.7.2.20020122124034.026d1750@arda.pair.com> <4.3.2.7.2.20020123011902.00cde840@arda.pair.com> <1011778534.638.11.camel@node89> <20020124170356.D28026@verdot.inria.fr> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Daniel de Rauglaudre a écrit : > > Hi, > > On Wed, Jan 23, 2002 at 10:35:34AM +0100, Christian Gillot wrote: > > > 3. the exceptions are NOT polymorphics > > exception of 'a list is WRONG. > > If they were, they could break the type system: > > exception Foo of 'a list;; > try raise Foo [3] with Foo l -> "abc" :: l;; > If the type system kept an annotation in types indicating if an expression may raise an exception, it would be correct (the above program would still be ill typed though). This annotation is just a kind of disjunction t or_raise ex1 or_raise ex2 ... it can be found in papers doing monadic encoding of exceptions (and there are two ways to do it: cps or disjunction which gives to kind of type translation). raise Foo [3] has type 'a or_raise Foo of int list try raise Foo [3] with Foo l -> l has type int list. This would be really nice, because the type system would infor you that your program can not have uncaught exception. (in soma cases) To be not to verbose, you could disable by default the printing of exceptions in types. You should be carefull that a -> (b or_raise ex1) is different from (a -> b) or_raise ex1 and that (b or_raise ex1) -> a is just useless while (a -> (b or_raise ex1)) -> c may be usefull. -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr