Skip to content

Comment on Async/await support in Firefoxparent

Comments

Yes, you can match async/wait with generators thus using them for monad computations in Javascript.

Think of async as return and await as bind.

"you can match async/wait with generators thus using them for monad computations in Javascript"

I hear the words you are saying, I just cant visualise the concept. Could you ELI5, or post an example?

Yes, check Bodil Stokke's presentation, The Miracle of Generators, at GOTO 2016.

https://www.youtube.com/watch?v=6mCkLZ0cwAI

OK- so basically: async/await, when used with generators and promises, allows monads.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.