Re:The Most Important Language Feature No One Talks About
by loup-vaillant on Tuesday October 20, 2009 @11:29AM
(#892546)
In Haskell, what you call a union type is more often called "sum type", or "tagged union". You declare them this way (your syntax was quite good):
You can use it that way:
This is not overloading. This is the same function. I also can write it this way:
So, the "choice" of union type is in the world of values, not in the world of types. Therefore, it isn't particularly relevant in the case of a type-based search.
[ Parent
| on HN ]
There are no comments on this comment yet.