Apparently the plain text attachments didn't work for everyone (and
they're not very readable via the list archive) so here they are again,
this time as a binary blob.
Phil
On 20/07/12 14:49, Phil Clayton wrote:
I have been making use of phantom types (for encoding a
single-inheritance
Phil,
I don't think your test-1.sml is correct Standard ML. If you cut it right down
to:
type ('a, 'b) t = 'b;
fun mkT n = (n : ('a, int) t);
val x = mkT 2;
You will find that Poly/ML says:
Warning-The type of (x) contains a free type variable. Setting it to a unique
monotype.
val x = 2:
Rob,
That's immensely useful. I was miles away from value restriction.
There shouldn't be any value restriction issue here - there isn't
polymorphism where you may think there is. As you point out, entering
at the top level gives
val x = 2: (_a, int) t
and a warning about inventing