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

Fortunately, with a bit of hacking, this style of syntax is possible without generators :) (I'm hoping to open source a library I wrote that works all the way back to IE6)

Here's your example rewritten in the 'monads' library (I probably need a better name):

monads(function() { var ra = opA.defer(); var rb = opB.defer(); var result = opC(ra(), rb()); });



Is that open source? I'd be interested in taking a look.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: