Hacker News new | ask | show | jobs
by jmite 4208 days ago
The thing is, "sum types" really only works if you're familiar with the analogy between boolean algebra and arithmetic (why OR becomes +).

Yes, they are disjoint union, but there's really no such thing as non-disjoint union in a statically typed language i.e. that's what makes it typesafe.

1 comments

You can have "non-disjoint unions" in typesafe languages, you just will be no longer capable of distinguishing between the types of the members.