Javascript 里面的 Promise 对应 Haskell 里的 Monad,把操作封装在 Promise/Monad 里。 ```javascript async function do(){ let a = await JobOne(); let b = await JobTwo(); return c; } ``` ```haskell do' = do a <- job_one b <- job_two return c ``` 只不过没有haskell那些类型约束=-=
Activity
AllanZyne commentedon Dec 3, 2016
= = (PS 你博客上的多说有问题了
impasse commentedon Dec 3, 2016
多说的问题有点头疼。。最近在考虑不用了。。
[-]突然想到 Javscript 里的 async-await 和 Haskell 里的 do-notation 是一个东西[/-][+]突然想到 Javascript 里的 async-await 和 Haskell 里的 do-notation 是一个东西[/+]