News for hackers. Stuff that matters.
Re:Where does the name "algebraic data type" come from? by marcosdumay on Wednesday July 31, 2024 @03:09PM (#41122366)
Given the types: I = A + B; J = C; X = A; Y = B + C

Is I + J the same type as X + Y?

If your types are tagged, they aren't. Because that's what tags do.

Re:Where does the name "algebraic data type" come from? by paholg on Wednesday July 31, 2024 @03:44PM (#41122729)
Okay? I don't know what point you're making.
Re:Where does the name "algebraic data type" come from? by bombela on Wednesday July 31, 2024 @11:11PM (#41125817)
My answer would be: No they are not the same type. Yes they have the same amount of bits representing them. They might have different RAM usage because of alignment.
Re:Where does the name "algebraic data type" come from? by xigoi on Thursday August 01, 2024 @03:00AM (#41126787)
> Is I + J the same type as X + Y?

They are not the same, but they are isomorphic. Just like with (A×B)×C versus A×(B×C).