You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
I've been exploring control.async and data.task as a way of encapsulating promises into tasks so that promises are not executed until I call fork(..). I find this concept very useful, much like the use of IO to encapsulate code that causes side effects.
Trying out some simple examples, it seems to me that fromPromise executes the promise immediately. This is not fromPromise's fault, but rather that new Promise(..) is not lazy; it does not wait until the call to then before executing the code.
One way around this might be to add something along the lines of a fromPromiseFn function:
Then, instead of using fromPromise(readFile(filename)), you'd use fromPromiseFn(readFile, filename) to defer the creation of the Promise until fork(..) gets called.