caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Andreas Rossberg <rossberg@ps.uni-sb.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] partial application warning unreliable?
Date: Sat, 10 Dec 2005 04:17:28 +1100	[thread overview]
Message-ID: <1134148648.8940.167.camel@rosella> (raw)
In-Reply-To: <439976E0.305@ps.uni-sb.de>

On Fri, 2005-12-09 at 13:21 +0100, Andreas Rossberg wrote:
> skaller wrote:
> > 
> > The correct type is void, however unit
> > will catch more errors than 'a.
> 
> IIRC, this has been discussed in the past, but since you iterate this 
> statement repeatedly, let me reinforce that it is incorrect.

Well it seems to achieve the desired result in Felix.

In particular, neither malc nor myself would have had
our bugs slip past the Felix type system the way they
slipped past Ocaml. However using unit instead would
have caught both our bugs I think, but fail to
eliminate:

	f: int -> 1
	g: 1 -> int

	let x = g ( f 1 ) in

which is clearly still wrong -- you should be required to write
this as

	f 1;
	let x = g () in

to explicitly sequence the side effects. Felix allows

	f: int -> 0

but not

	g: 0 -> int

and thus, the expression:

	g (f 1)

cannot type check (for any g). This forces you to explicitly
sequence side effects, which is the intended result.
BTW: it isn't clear this is entirely desirable!

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2005-12-09 17:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-08  2:39 skaller
2005-12-08  3:10 ` [Caml-list] " Jacques Garrigue
2005-12-08  7:11   ` skaller
2005-12-08 14:41     ` Damien Doligez
2005-12-08 23:51   ` malc
2005-12-09  1:43     ` skaller
2005-12-09  2:15       ` Jacques Garrigue
2005-12-09  2:56         ` skaller
2005-12-09 15:26         ` malc
2005-12-10  0:49           ` Jacques Garrigue
2005-12-10  1:40             ` malc
2005-12-09 12:21       ` Andreas Rossberg
2005-12-09 17:17         ` skaller [this message]
2005-12-09 17:52           ` Andrej Bauer
2005-12-09 18:54           ` Andreas Rossberg

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=1134148648.8940.167.camel@rosella \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=rossberg@ps.uni-sb.de \
    /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;
as well as URLs for NNTP newsgroup(s).