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

> Maybe type instead of null pointers.

It's often a bad sign when a language advertises this high up on its features list. It means that they didn't really get the true takeaway of the Maybe type (which is that you should support algebraic data types to properly constraint data to valid states), but instead saw a single specific use case of ADTs (Maybe) and thought that's all there was to it.

I've run into this with Java 8. Optional is pretty common now and has eliminated the need for the null pointer in much of everyday code, but they still don't have something like Either to eliminate the need for exceptions. Maybe is extremely useful, but it's a small fraction of the usefulness you get with true ADT support.



Zig also has algebraic data types.


Are they ML like ADTs with pattern matching? That would be awesome.


Any examples? There were none at OP's link.




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

Search: