Hacker News new | ask | show | jobs
by gpderetta 1066 days ago
Sure, as long as I can close over a yield object. There is no reason for filter and map to know that the last function parameter takes a continuation.
1 comments

But then, how could you guarantee type safety?

This yield is not an object, it is handling the execution context to another stack.

It is a delimited one-shot continuation. Delimited continuations are first class objects like any other and it should be possible to close over them.