Promise.resolve("We start here")
.then(x => Promise.resolve(x + " then get here"))
.then(x => Promise.resolve(x + " and finally here!"))
Right("We start here")
>>= (\x -> Right (x ++ " then get here"))
>>= (\x -> Right (x ++ " and finally here!"))
Promise.resolve("We start here")
.then(x => Promise.resolve(x + " then get here"))
.then(x => Promise.reject("Oh noes!"))
.then(x => Promise.resolve(x + " and finally here!"))
Right("We start here")
>>= (\x -> Right (x ++ " then get here"))
>>= (\x -> Left("Oh noes!"))
>>= (\x -> Right (x ++ " and finally here!"))