Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Re: OCaml typechecking bug? (PR#3104) [about phantom types]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-27 (05:43)
From: brogoff <brogoff@s...>
Subject: Re: [Caml-list] Re: OCaml typechecking bug? (PR#3104) [about phantom types]
On Fri, 27 Aug 2004, Jacques GARRIGUE wrote:
> Not surprising: the distinction is not between built-in and
> user-defined, but between abbreviation types and datatypes (which
> share the same syntax in ocaml, but have different syntax in most
> other dialects)
> This behaviour is perfectly normal.
> In the above signature, the type t is not phantom at all.
> It will be expanded to int before checking equality, so the type
> argument will be completely ignored altogether.

OK, ignore my request for further explanation, it all makes good sense now,
even though it was counterintuitive behavior at first. It does suggest that
making a syntactic distinction between type abbreviation and datatype
definition a la SML is a good idea.

I never ran across this behavior before since I assumed the phantom type had to
be abstract and always coded it that way.

All of this phantom type stuff makes me wish we had dependent types anyways...

-- Brian

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: