datatype foo = A of () | B of (int) | C of (int, double)
There are three types foo_A, foo_B, and foo_C associated with foo which are
for values constructed by
A, B, and C, respectively. These types can be described using C-syntax as
follows:
Then this is datatype is like an enum type in C. Internally, Monday(),
Tuesday()
and Wednesday() are represented by 0, 1, and 2 because they the first,
second
and third constructors associated with the datatype weekday.
end // end of [local]On Tuesday, January 14, 2014 3:18:28 PM UTC-5, gmhwxi wrote:
Say you have a datatype declared as follows:
datatype foo = A of () | B of (int) | C of (int, double)
There are three types foo_A, foo_B, and foo_C associated with foo which
are for values constructed by
A, B, and C, respectively. These types can be described using C-syntax as
follows:
Then this is datatype is like an enum type in C. Internally, Monday(),
Tuesday()
and Wednesday() are represented by 0, 1, and 2 because they the first,
second
and third constructors associated with the datatype weekday.