// in using Task based on the fun-task library
Task.create((res, rej) => res(5)).run({
success: console.log,
failure: console.error
});
// 5
// using Future through Fluture
Future((reject, resolve) => res(5)).fork(
console.error,
console.log
);
// 5
正如您在此处看到的,两者都接受函数计算,惰性且都是可组合的。那么这些类型之间的主要区别是什么。