Comment #0 by bearophile_hugs — 2010-10-20T05:04:21Z
Algebraic data types may be both product types and sum types:
From Wikipedia:
http://en.wikipedia.org/wiki/Algebraic_data_types
> Special cases of algebraic types are product types i.e. tuples and
> records (only one constructor), sum types or tagged unions (many
> constructors with a single argument) and enumerated types (many
> constructors with no arguments). Algebraic types are one kind of
> composite type (i.e. a type formed by combining other types).
So std.typecons.Tuple too is an algebraic data type, it's a product type. The data structure implemented by std.variant.Algebraic is just a special case of algebraic data type, it's a sum type.
So it is better if the name of std.variant.Algebraic refers to 'sum type' or a 'tagged union' instead to generic data types.
So maybe "taggedUnion" is a more descriptive name of its purposes for programmers of C-like languages.
Comment #1 by andrei — 2013-02-26T08:54:31Z
I don't think there's an action item that can be derived from this. OK to close?
Comment #2 by bearophile_hugs — 2013-02-26T10:49:21Z
(In reply to comment #1)
> I don't think there's an action item that can be derived from this. OK to
> close?
Closed.
Comment #3 by andrej.mitrovich — 2013-02-26T10:50:18Z
No associated pull -> WORKSFORME.
Comment #4 by bearophile_hugs — 2013-02-26T10:51:27Z
(In reply to comment #3)
> No associated pull -> WORKSFORME.
Isn't WONTFIX more correct for this situation? :-)
Comment #5 by andrej.mitrovich — 2013-02-26T10:52:02Z
(In reply to comment #4)
> (In reply to comment #3)
> > No associated pull -> WORKSFORME.
>
> Isn't WONTFIX more correct for this situation? :-)
Sure thing.