Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Futures-for-futures #13

Closed
domenic opened this issue Feb 5, 2013 · 1 comment
Closed

Futures-for-futures #13

domenic opened this issue Feb 5, 2013 · 1 comment

Comments

@domenic
Copy link
Collaborator

domenic commented Feb 5, 2013

I feel like I tried to bring this up earlier, but it deserves its own issue.

Futures-for-futures are hazardous in the following manner (via @briancavalier, indirectly via MarkM, I believe):

let future = new Future(({ accept }) => accept(5));
let futureForFuture = new Future(({ accept }) => accept(future));

let identity = x => x;

// With ordinary futures, this is a composable identity transformation:
let a = future.then(identity);
// That is, `a` will be accepted with `5` as its value, just like `future`.

// But with futures for futures, identity is broken:
let b = futureForFuture.then(identity);
// That is, `b` will be accepted with `5` as its value, but
// `futureForFuture` of course has `future` as its value.

// This prevents `identity` from being used as a no-op in the general case.

Do you agree that this is a problem? If so, I am happy to discuss solutions, as we have been doing over in Promises/A+ land. If not, /shrug.

@slightlyoff
Copy link
Owner

I don't accept that this is a practical issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants