Re: Proposal for study: Add a categorical Initial type to ocaml

From: William Chesters (williamc@dai.ed.ac.uk)
Date: Sun Oct 10 1999 - 23:05:26 MET DST


Date: Sun, 10 Oct 1999 22:05:26 +0100
Message-Id: <24984.199910102105@buckie>
From: William Chesters <williamc@dai.ed.ac.uk>
To: caml-list@inria.fr
Subject: Re: Proposal for study: Add a categorical Initial type to ocaml
In-Reply-To: <38002EBF.DF0EF779@maxtal.com.au>
        <37FC6572.719AD12D@tsc.uc3m.es>

skaller writes:
> > > Boxed values can use a null pointer for none.
> >
> > I have a question--how is this different (except for the efficiency of
> > using null) from using a 'a option array?
>
> It isn't, in theory, it is exactly the same (and therefore sound).

I think (correct me if I'm wrong, sorry) that this is a return to an
issue which seems to be a bit of an FAQ.

The problem is that if you have a value of the type `int option
option', you have to be able to distinguish between `None' and `Some
None'! If both the enumeration-indirections are elided, you can't; if
only one of them is, you have inconsistency which would presumably
have to be resolved using whole-program optimisation or something.

For the lowdown and an interesting proposal for a fix, see

        http://caml.inria.fr/pub/old_caml_site/caml-list/0967.html

The same idea would obviously apply to arrays.



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:26 MET