[MLton-user] Wish for a standard sum type

Andreas Rossberg AndreasRossberg@web.de
Thu, 1 Jun 2006 20:13:07 +0200


"Jesper Louis Andersen" <jlouis@mongers.org> wrote:
>
> signature ALTERNATE =
> sig
>     type ('a, 'b) t


You successfully duck the issue of naming the type itself here ;-)

> Do I miss any kind of operations which are obviously defineable for an
> Alternate type.

Here is what the Alice ML library defines:

http://www.ps.uni-sb.de/alice/manual/library/alt.html

> I did also discuss, quickly, the naming of the type with
> Andrzej Filinski, who preferred INL, INR or IN1, IN2, ...,INn. His good
> reason to reject FST and SND was that fst and snd are defined on A * B
> (the product composition on types) rather than A + B (the sum
> composition), technical or not, heh.


The underlying dualism in fact was one of the reasons for this choice. :-)
But I agree that it may have too much potential for confusion.

  - Andreas