[MLton-user] Wish for a standard sum type

Vesa Karvonen vesa.karvonen@cs.helsinki.fi
Mon, 29 May 2006 19:54:48 +0300


Quoting Jesper Louis Andersen <jlouis@mongers.org>:
> datatype ('a, 'b) either = INL of 'a
>                          | INR of 'b

I like this one.  Now that I think about it, I recall seeing this
naming used somewhere (article or book).

The "IN" part also nicely suggests the antonym for the occasionally
useful partial destructors:

  fun outL (INL x) = x
  fun outR (INR x) = x

-Vesa Karvonen