1 (* This should fail because
'a
-> 'b is not a
type name
;
2 * The Defn does not treat
-> as a
TyName(2), but rather
as a distinct
3 * sub
-class
of Type
. *)
6 datatype ('a
, 'b
) t
= T
of 'a
-> 'b
7 end where type ('a
, 'b
) t
= 'a
-> 'b
9 (* Similarly
, this should fail because
'a
* 'b is not a
type name
;
10 * it is a synonym for
{1: 'a
, 2: 'b
}, which is RowType
. *)
13 datatype ('a
, 'b
) t
= T
of 'a
* 'b
14 end where type ('a
, 'b
) t
= 'a
* 'b
16 (* Similarly
, this should fail because
'a
* 'b is not a
type name
;
17 * it is a synonym for
{1: 'a
, 2: 'b
}, which is RowType
. *)
20 datatype t
= T
of unit
21 end where type t
= unit
23 (* On the other hand
, The Defn does treat
'ref
' and 'int' and other
24 * primitive types
as TyName(k
); see Appendix C
. Hence
, the following
28 datatype 'a t
= T
of 'a ref
29 end where type 'a t
= 'a ref
33 end where type t
= int