News for hackers. Stuff that matters.
Re:JavaScript Promises Discussion: Make Them Monadic? (2013) by ballenf on Thursday February 15, 2018 @08:59PM (#16389340)
The hardest part for me when I was new to Promises was that multi-layer promises would magically vanish. It was so counter-intuitive from every other programming paradigm — nested loops, deep/complex objects, and functional closures.

I lost several days struggling against the concept until realizing that Promises were intended and designed to work differently than every other aspect of the language.

Can you imagine the language stripping out a nested returned function and instead executing it and returning the value? That’s what Promises will do.

There are no comments on this comment yet.