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

Hardly. Erlang and OCaml function in an implicit, ambient monad which makes some default choices like "single thread of execution, sequential, deterministic state, has exceptions" and each will use monads when a different choice of monad is useful.

As a simple example, if you'll buy that by your reasoning OCaml would find monads to be a "useless, redundant abstraction which will only clutter the code", then I'd ask why both Async and Lwt are built to be monadic? Or, if you still feel that's a mistake, how you'd design them elsewise?




Why, it is mere an ADT. If you think it is useful - you use it. If you think it is redundant - you use something else.

I've tried to explain my view in the comment above.


I'm not sure I understand from either post.

Or rather, I think your perspective is better handled by a language which supports monads than one without. If I want a new execution context in Haskell—it's a mere ADT, if I don't think it's useful I use something else.

My point is that everything imperative lives in a monad. If you want, you can choose to be explicit about it which opens new freedoms. Or, if you don't, you can just use the ambient one in languages which have those. Sometimes people realize great things by picking new monads. If it's convenient enough you can do it every other line to great effect.

Ambient monads can be a little annoying though since when they exist you cannot "get outside of them" which will reduce your flexibility.




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: