Many thanks Matthew for the clarification. Subtle :-)
Since datatype declarations declare both a type operator
and constructors, I think the explanation deserves to appear
in http://mlton.org/EqualityTypeVariable, last part.
The last two declarations declare identical type operators, but
not
Hello,
Funnily (where my belief came from ?), the page about equality type
variables on mlton.org (http://mlton.org/EqualityTypeVariable)
says that they play no special role in either type bindings or
datatype bindings, contradicting the compiler ...
BB.
On 9/16/16 10:42 PM, Bernard
Bernard,
That refers to a "type function" not a datatype binding.
type ''a t = ''a * ''a
creates a type function and indeed Poly/ML ignores the equality
attribute in that case. A datatype binding creates a new "type name"
and that is dealt with elsewhere.
The fact that both mlton and hamlet
> On 16 Sep 2016, at 20:59, Bernard Berthomieu
> wrote:
>
> ...
> I like the treatment of polyML :-), but I guess it is not standard:
>
> The "definition" (http://sml-family.org/sml97-defn.pdf) says, page 19:
> "... In particular, the equality attribute has no
Hello,
Besides any printing/elaboration problem with polyml 5.6:
In polyml 5.5:
> datatype ''a t = C of ''a;
datatype ''a t = C of ''a
> C 1.0;
Error-Type error in function application.
Function: C : ''a -> ''a t
Argument: 1.0 : real
Reason: Can't unify ''a to real (Requires equality
Rob,
Actually what I was trying to find was the bit that says that the
equality attribute in a type variable used as a datatype parameter
should be honoured where it isn't when used as a type parameter.
> type ''a t = ''a * ''a;
type 'a t = 'a * 'a
> (1.0, 2.0): real t;
val it = (1.0, 2.0):
David,
> On 16 Sep 2016, at 19:19, David Matthews
> wrote:
>
> I've checked hamlet and mlton and they both reject it so I think in this case
> Poly/ML is right and SML/NJ is wrong. I can't point to the bit of the
> definition that says that, though.
It's in
On 16/09/2016 16:12, Tjark Weber wrote:
Hi,
Is the following behavior (of Poly/ML 5.6) intended?
> datatype ''a t = C of ''a;
datatype 'a t = C of ''b
I'll look at the printing here. There was a change in 5.5 that seems to
have broken it.
Moreover, Poly/ML rejects a following
> C
Hi,
Is the following behavior (of Poly/ML 5.6) intended?
> datatype ''a t = C of ''a;
datatype 'a t = C of ''b
Moreover, Poly/ML rejects a following
> C 1.0;
while SML/NJ accepts it.
Best,
Tjark
___
polyml mailing list
polyml@inf.ed.ac.uk