Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Christophe Raffalli <raffalli@univ-savoie.fr>
To: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] Re: about toplevels
Date: Thu, 24 Jan 2002 18:20:38 +0100	[thread overview]
Message-ID: <3C504266.907EE3EA@univ-savoie.fr> (raw)
In-Reply-To: <20020124170356.D28026@verdot.inria.fr>

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


  reply	other threads:[~2002-01-25  8:52 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-21 23:27 cgillot
2002-01-21 22:43 ` [Caml-list] Re: your mail Markus Mottl
2002-01-22  0:03   ` [Caml-list] Re: about toplevels cgillot
2002-01-22 20:41     ` Chris Hecker
2002-01-22 21:35       ` [Caml-list] Ocaml and games Matthew D Moss
2002-01-22 21:43         ` Will Benton
2002-01-22 23:53         ` Eric C. Cooper
2002-01-23  0:58         ` Ian Zimmerman
2002-01-23  1:23         ` Yaron M. Minsky
2002-01-23  3:29         ` Doug Bagley
2002-01-23  5:20         ` Chris Hecker
2002-01-24  3:02           ` Matthew D Moss
2002-01-24  6:59           ` Chris Hecker
2002-01-25 20:22           ` Daniel Phillips
2002-01-25 20:53             ` Ken Rose
2002-01-25 22:16             ` Chris Hecker
2002-01-25 23:00               ` Thatcher Ulrich
2002-01-23  8:39         ` Sven
2002-01-23 15:35         ` Xavier Leroy
2002-01-22  9:00   ` [Caml-list] Re: your mail Daniel de Rauglaudre
2002-01-22 13:12     ` Markus Mottl
     [not found] ` <4.3.2.7.2.20020123011902.00cde840@arda.pair.com>
2002-01-23  9:35   ` [Caml-list] Re: about toplevels Christian Gillot
2002-01-23 10:20     ` Chris Hecker
2002-01-24 16:03     ` Daniel de Rauglaudre
2002-01-24 17:20       ` Christophe Raffalli [this message]
2002-01-24 17:34       ` Christian Gillot
2002-01-24 20:42     ` [Caml-list] gotchas [Was: toplevels] Ian Zimmerman
2002-01-25 10:59       ` Christian Gillot
2002-01-25 11:17         ` Sven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C504266.907EE3EA@univ-savoie.fr \
    --to=raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    --cc=daniel.de_rauglaudre@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox