Hacker News new | past | comments | ask | show | jobs | submit login

Sum types make very little sense in dynamically typed languages even with good manipulation of user-defined values. For instance Erlang does not have "formal" sum types, it wouldn't really bring anything useful to the table, the compiler does not typecheck by default (so the sum type would just be a complication with no benefits) and Dialyzer can simulate them by using type/value unions e.g.

    {ok, integer()} | {err, string()}



While I agree that there would be no point to user-defined sum types, constructor classes would be a strict improvement over what Erlang has.




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

Search: