Programmer-Defined “Datatypes”
Use datatype to create an entirely new type -- one which could not be expressed using only the basic types, tuples, and lists.
datatype color = Red | Yellow | Green;
datatype color Green | Red | Yellow
val mycolor = Red : color
fun okToGo c = if c = Green then true else false;
val okToGo fn : color -> bool