x = x + 1;
function repeat(x) {
return x + repeat(x);
}
x = x + 1;
function repeat(x) {
return x + repeat(x);
}
repeat x = x ++ repeat x
threeFs = take 3 (repeat "f")
> "fff"
function repeat(x) {
return x + repeat(x);
}
threeFs = repeat("f").substr(0,3);
> InternalError: too much recursion
x => x + 1;
function(x) {
return x+1;
}
Promise.resolve("Some value").then(x => Promise.resolve(x + " and another value")).then(x => Promise.resolve(x + " and another one!"));
Promise.resolve("Some value").then(x => Promise.reject("It's all gone wrong")).then(x => Promise.resolve(x + " and another one!"));
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!"))