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

But as soon as you're using "Maybe", you're impeding much of a type systems strengths, as the article outlined.



Only if there is actually anything more you can say about String that would let you avoid the Maybe. If this is raw data and you don't even know that the JSON is well formatted (else why can a parse straight to a generic JSON object fail) then there's not any better way to type it.

You might want to return an error message on failure, or provide a mechanism for recovery, but those are somewhat specific to the use case and don't really address the key point of the article.


It's really a matter of what you care about to accomplish.

My point is that Python objects are certain data structure and if you bother to create type for it them then you can use it in function type.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: