Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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:
[...snip...]
> 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)
[...snip...]
> 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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners