Privacy Policy Cookie Policy Terms and Conditions Talk:Tagged union - Wikipedia, the free encyclopedia

Talk:Tagged union

From Wikipedia, the free encyclopedia

Uh, I suggest you reconsider your tagged union example for Pascal, not so much because of the Big-Brother implications of an Employee record tracking how many lovers someone has, which is merely bad from a legal and social point of view, but more because it has a serious logical flaw: it assumes that marriage and multiple lovers are mutually exclusive. This, of course, is fundamentally in error, making this a bad example of a tagged union, whose alternatives must be exclusive. Using code examples that demonstrate a significant misapprehension of one's problem domain only encourages buggy programming.

---

This is entirely true - I'll try and think of a better example. I was operating under the false assumption of 100% fidelity. It's a silly example anyway. Derrick Coetzee 13:54, 4 Feb 2004 (UTC)


[edit] Merge on tagged union

I'd like your justification on the merge header you added to tagged union. I'm inclined to remove it, since there's a great deal more to be said about tagged unions than about unions in general. That said, I have considered merging it into a term which does not imply a particular implementation, such as disjoint union or discriminated union. Derrick Coetzee 00:55, 19 Sep 2004 (UTC)

I agree that there is a great deal to say about tagged union. But, I ask, is there much to say about untagged union? Although I don't know which is more popular, tagged or untagged union, I believe the theoritical importance is about tagged union and I seems to me untagged union is really just lousy datatype or something not really union. And as you see, the current union article is really about untagged union and is not so good actually. If not merge, another option would be let tagged union be a new union and the current union article to be untagged union. I guess I don't believe there is a great deal to say about union in general and untagged union. Do you think not? -- Taku 01:15, Sep 19, 2004 (UTC)
Put in another way, I don't believe union in C/C++ is a good example of union. It is too primitive and is usually not used in the way unions are supposed to be used. -- Taku 01:18, Sep 19, 2004 (UTC)
This is not so much a question of importance as of word usage. The word union by itself almost exclusively refers to untagged unions, both in the literature and in popular culture (where it's used almost entirely in the C/C++ community). Tagged unions are not called tagged unions quite so often, however. In literature they're generally called discriminated or disjoint unions, but these terms are often considered to refer to the pure mathematical set theory concept. As a programming concept about the closest thing is ML's datatype construction, which is obviously an ambiguous term. The term tagged union is fairly widely used and understood, and avoids the problems with other terms, but to many it seems to imply a particular implementation (the use of an explicit tag field), which isn't quite what I intended. Derrick Coetzee 02:22, 19 Sep 2004 (UTC)

I don't think the term tagged union has any problem; it is well-understood and unambigous. But the question is do we need a separate article about untagged unions. I doubt the current union (computer science) will grow in the way there is little overlap with tagged union. I know that a name union particularly gives an impression of union type in C. But the article should be about a concept of union datatype in general and I don't think there are a lot to say about unions without the way of type checking, or tagging. I think we use terms like discriminated unions or such because we want to emphasize they are tagged, like we say static type checking instead of just type checking. But discussing the general concept, we don't have to be too specific. If you really want to see a name tagged and to avoid a false impression, we can name the combined article "tagged and untagged union", "union datatype" or something, though I think it is unnecessary. -- Taku 05:50, Sep 19, 2004 (UTC)

I think the links to tagged union in the union (computer science) article, which I made repeated and prominent (self-advertising after all ;) serve this purpose well enough. Another reason I avoid use of the word union for a discriminated union is because as mathematical concepts these are entirely distinct, and the Wikipedia already professes this viewpoint in the articles union (set theory) and discriminated union. You'll never hear the word untagged or undiscriminated union in mathematical discourse, to my knowledge. Derrick Coetzee 23:46, 20 Sep 2004 (UTC)
THIS WEB:

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - be - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - closed_zh_tw - co - cr - cs - csb - cu - cv - cy - da - de - diq - dv - dz - ee - el - eml - en - eo - es - et - eu - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gd - gl - glk - gn - got - gu - gv - ha - haw - he - hi - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mg - mh - mi - mk - ml - mn - mo - mr - ms - mt - mus - my - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - rm - rmy - rn - ro - roa_rup - roa_tara - ru - ru_sib - rw - sa - sc - scn - sco - sd - se - searchcom - sg - sh - si - simple - sk - sl - sm - sn - so - sq - sr - ss - st - su - sv - sw - ta - te - test - tet - tg - th - ti - tk - tl - tlh - tn - to - tokipona - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007:

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - be - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - closed_zh_tw - co - cr - cs - csb - cu - cv - cy - da - de - diq - dv - dz - ee - el - eml - en - eo - es - et - eu - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gd - gl - glk - gn - got - gu - gv - ha - haw - he - hi - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mg - mh - mi - mk - ml - mn - mo - mr - ms - mt - mus - my - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - rm - rmy - rn - ro - roa_rup - roa_tara - ru - ru_sib - rw - sa - sc - scn - sco - sd - se - searchcom - sg - sh - si - simple - sk - sl - sm - sn - so - sq - sr - ss - st - su - sv - sw - ta - te - test - tet - tg - th - ti - tk - tl - tlh - tn - to - tokipona - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia 2006:

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - be - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - closed_zh_tw - co - cr - cs - csb - cu - cv - cy - da - de - diq - dv - dz - ee - el - eml - en - eo - es - et - eu - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gd - gl - glk - gn - got - gu - gv - ha - haw - he - hi - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mg - mh - mi - mk - ml - mn - mo - mr - ms - mt - mus - my - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - rm - rmy - rn - ro - roa_rup - roa_tara - ru - ru_sib - rw - sa - sc - scn - sco - sd - se - searchcom - sg - sh - si - simple - sk - sl - sm - sn - so - sq - sr - ss - st - su - sv - sw - ta - te - test - tet - tg - th - ti - tk - tl - tlh - tn - to - tokipona - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu