Hacker News new | ask | show | jobs
by shados 3062 days ago
the only real issue with promises not following monadic laws is that once you try to compose various monads, you have to rethink all of the properties because you can't just fall back to any document about monads ever and hope that things will work like that.

It's kind of like implementing all of the gang of 4 design patterns but with some small differences. Kinds of make the whole language pointless.

In term of just getting stuff kind of working, yeah, they work fine. I worked on a library that had to do monad-like composition in extremely limited space, but promises were available to me, so I just built everything on top of those to fake it with as few bytes as possible. Pain in the ass to reason around and debug, but it worked.