Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are sums at the type and value level. If I define Color = Red | Blue | Green, that’s not a use of a type which sums types together, but instead just is a type composed of a sum of values.

So a “sum type” can be any type which is the sum of different values. On the other hand, Either is a canonical “sum type (constructor)” which sums two types together (via the summation of their vaues).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: