From: Andreas Rossberg <rossberg@ps.uni-sb.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] partial application warning unreliable?
Date: Fri, 09 Dec 2005 13:21:52 +0100 [thread overview]
Message-ID: <439976E0.305@ps.uni-sb.de> (raw)
In-Reply-To: <1134092611.8940.57.camel@rosella>
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.
Void is the empty type. No value of this type can be constructed. Since
in ML, everything is an expression, and every "procedure" a function,
they all have to evaluate to something. Hence, the only possible
functions with result type void are those that do not return. The only
possible functions with argument type void are those that can never be
called.
The type unit on the other hand, is the trivial type. It carries just
one value, and hence no information. Consequently, it is the canonical
type to use for functions that do not require or do not return any
information.
Type theory wasn't well developed in the 60s, when Algol 68 (I think)
introduced its notion of void type that was later inherited, in even
more abusive ways, by C and friends. The name is just historical
accident, it really ought to be unit.
- Andreas
--
Andreas Rossberg, rossberg@ps.uni-sb.de
Let's get rid of those possible thingies! -- TB
next prev parent reply other threads:[~2005-12-09 12:21 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 [this message]
2005-12-09 17:17 ` skaller
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=439976E0.305@ps.uni-sb.de \
--to=rossberg@ps.uni-sb.de \
--cc=caml-list@yquem.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