datatype t = T of int * real (* 0 arguments *) type 'a t = 'a * int (* 1 argument *) datatype ('a, 'b) t = A | B of 'a * 'b (* 2 arguments *) type ('a, 'b, 'c) t = 'a * ('b -> 'c) (* 3 arguments *)
Here are the syntax rules for type constructor application.
-
Type constructor application is written in postfix. So, one writes int list, not list int.
-
Unary type constructors drop the parens, so one writes int list, not (int) list.
-
Nullary type constructors drop the argument entirely, so one writes int, not () int.
-
N-ary type constructors use tuple notation; for example, (int, real) t.
-
Type constructor application associates to the left. So, int ref list is the same as (int ref) list.