a shorter phrase than "algebraic data type"

Mark Carroll mark@chaos.x-philes.com
Wed, 29 Aug 2001 09:13:36 -0400 (EDT)


On Wed, 29 Aug 2001, Hannah Schroeter wrote:
(snip)
> On Tue, Aug 28, 2001 at 03:44:26PM -0500, Mark Carroll wrote:
> > They remind me of union types, as in C (IIRC - I never used them),
> > for what little that's worth.
> 
> No. C-unions are untagged and thus, not really type safe. Haskell's
> sum types *are* tagged and thus quite safe (except for incomplete
> pattern matches which may cause some evaluation to diverge).

I only said they reminded me of them, and C was just an example of where
I'd seen such things! (-: I can imagine that the term "union types"
connote something confusingly wrong, but I'd hardly imagine that the type
safety issue would be it, given that in Haskell one can largely take type
safety for granted - nowhere did I intend to say that Haskell's algebraic
types behave exactly as C's union types do! In the same way, I don't think
it's unreasonable for many languages to have floats and integers and
whatnot even though they tend to treat them subtly differently (in how
they approach with 0/0, overflows, etc.),

I'm not meaning to be defensive - I don't care what shorter term someone
uses for such types - I just wanted to express the idea that I find the
being tagged or not as an implementation detail that isn't the first thing
I think of with union types - instead, I more or less think of why they're
named - the thing's possible types are a union of a few types - and that
I'm surprised that others strongly associate the lack of tagging with this
concept. I'll have to watch out for that in future.

-- Mark