hello.then(a => return op1(a)).then(b => return op2(b)).then(c => console.log(c); const a = await hello(); const b = await op1(a); const c = await op2(b); console.log(c)
hello >>= (\a -> op1 a >>= (\b -> op2 b >>= (\c -> show c))) do { a <- hello; b <- op1 a; c <- op2 b; show c }
Ia desugared to m >>= (\a -> return r)
Think of it m.then(function (a) return r)