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

I mean, monads famously don't compose - you have to write a bunch of monad transformers.



True, but not a huge real world issue in nearly all the relevant cases.

I can very easily have a fallible, asynchronous, multi-value, stateful, database connected computation that returns a Bool and use it in let’s say ‘filterM’.

Most transformers are already written for me.

Edit: switching between no effect and some effect is the tricky part though.


I find in practice that even though I don't have to write the transformers myself, `lift`ing and `unlift`ing things is a pain in the ass. Once you try a proper algebraic effect system, it's hard to feel like transformers are an adequate solution.


Most of the relevant plumbing is generic though. Check out ZIO or cats-effect in Scala which I think both provide highly composable effect systems.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: