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

Whenever I've used Haskell, the monads infect things like a virus, similar to the way async/await metastasizes across a C# codebase.

Note: I am not very good at Haskell.



That's what happens when you're working in a pervasive-mutability-by-default (or pervasive-IO-by-default) language as well - your whole codebase is full of hidden state mutations and hidden interactions with the outside world. You just don't have any idea where they're happening. You can write Haskell in the same style with monads everywhere and you're in essentially the same situation (just with more visibility into it) - but then you can actually start isolating the parts where mutation or outside interaction happen, and separating them from your core business logic. Which is the same thing you'd do in a high-quality codebase in any other language, but in Haskell you can do it in a way that's actually enforced and visible rather than just convention.


Probably because async/await IS a monad. Avoiding that infection just takes some design experience.




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

Search: