Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Stefan Monnier" <monnier+lists/caml/news/@RUM.cs.yale.edu>
To: caml-list@inria.fr
Subject: Re: bottom types and threaded exits
Date: 30 Sep 2000 10:28:42 -0400	[thread overview]
Message-ID: <39d5f89a$1@tequila.cs.yale.edu> (raw)
In-Reply-To: <wxzokqtf8r.fsf@suburbia.net>

>>>>> "Julian" == Julian Assange <proff@iq.org> writes:
> It depends on what level of semantics you are looking at. As far as
> type proofing is concerned, 'a is correct. However at a higher level
> you can say `the function never returns so saying that it returns any
> type is incorrect'. The problem is that some functions that do return,

A function of type "t1 -> t2" does not necessarily return an object of type t2.
But if it does return, then the value is of type t2.
Similarly, a function of type "t1 -> 'a" (if it returns) returns an value
of type 'a.  Parametricity allows us to infer from that that if t1 does
not contain 'a as a free type variable, then the function will necessarily
never return (since it has no way to construct an value of
type 'a).

It would maybe be a good idea to analyze the types based on a few
such parametricity-derived theorems and print a more meaningful type
(i.e. use 'noreturn rather than 'a for the above case or 'ignored
for an argument type 'a which appears only once).


        Stefan



  parent reply	other threads:[~2000-10-02  8:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-23 14:25 Julian Assange
2000-09-24 19:14 ` Pierre Weis
2000-09-25 10:08 ` Remi VANICAT
2000-09-25 18:38   ` John Prevost
2000-09-26  9:16 ` Xavier Leroy
2000-09-30  9:12   ` Julian Assange
2000-09-30 14:25     ` Pierre Weis
2000-09-30 15:19       ` Markus Mottl
2000-09-30 14:28     ` Stefan Monnier [this message]
2000-10-02 13:11       ` Patrick M Doane
2000-10-02 16:28         ` Markus Mottl
2000-10-05 18:39           ` Pierre Weis
2000-09-25 19:56 Damien Doligez

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='39d5f89a$1@tequila.cs.yale.edu' \
    --to=monnier+lists/caml/news/@rum.cs.yale.edu \
    --cc=caml-list@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