Re: Last call for comments on SRFI 228: Composing Comparators
Lassi Kortela 16 Nov 2022 18:54 UTC
> Can you explain me? What is the difference between what you learned in
> your math class and what you called a union in programming?
The obvious connotation of "union", from set theory, is "all of these".
But we use a union type when we want to match "any of these" types.
There's a confusion between "any" and "all". "Any" is more precise. A
"sum type" and a "product type" both deal with "all of these types", but
they do it differently.
When we want to have "all of these" values we put them in a collection
such as a list, or indeed a set. A product type is closer to this meaning.
There's more of this with "row types", etc. The people who write higher
order functions (e.g. SRFI 1) tend to use everyday language that is easy
to understand and does not have overloaded connotations, but somehow the
types people use these verbose and confusing theory words. It detracts
from the usability of the tool.