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

> Is there any reason to use monads in (let's say) Javascript rather than promises?

Not intrinsically, IMO. The main value of monads is the shared interface, and its utility is contingent on tools that recognise that interface.

In that respect, it's as useful as providing e.g. a `map` method for promises, arrays, dictionaries, etc. Though in my experience JavaScript rarely seems to be written with this kind of generic interface in mind (e.g. there's no coherent interface mandated between classes in the standard library).



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: