News for hackers. Stuff that matters.
Re:The Algebra of Data and the Calculus of Mutation by joeyespo on Wednesday April 27, 2011 @12:14PM (#2489973)
Yeah it's definitely helpful to think of it that way.

I usually relate it to sets. Types are sets of possible objects, "+" indicates set-based union, and "*" is just the Cartesian product of the types.

Re:The Algebra of Data and the Calculus of Mutation by munificent on Wednesday April 27, 2011 @12:48PM (#2490095)
"+" isn't set union. If it was, int+int would just be int. The extra tag distinguishes it. Raw unions in C are like set union though.
Re:The Algebra of Data and the Calculus of Mutation by joeyespo on Wednesday April 27, 2011 @02:52PM (#2490615)
Right, it's a tagged union. I mean conceptually. You still end up with the same domain of objects as a union. The tag just tells you which domain you're object is in. (Or which side rather, since the domains can intersect.)