Comments (3)
See also #35
from fluture.
I am probably misunderstanding you but, a Future can be easily turned into a Promise by using Future.promise
.
In my opinion, adding a .then
method to Futures would be misleading. In case it simply converts the Future into a Promise, could we say that Futures are Thenables? Once you call .then
you've already lost the Future. And if we want to keep them as Thenable Futures I imagine it would require a non-straight forward .then
implementation that returns a Future. And I don't really know how things like eagerness/laziness and cancellations, would behave in that case. I don't think is worth the burden. But I might be completely wrong here.
I can also imagine it would be confusing for newcomers, and it doesn't really fit in the current API design in which most method have been converted into functions. Although, one could always implement the .then
method in user-land.
Future.prototype.then = function (f, g) { return Future.promise (this).then (f, g); }
from fluture.
I agree with you that it will be confusing for newcomers.
The idea comes to my mind building a lib to work with the DB that lazy return Fluture futures. My object implement a fork method, like Fluture operator.
But there is no a standard interface between Fluture (F.lock()()()), my lib (myobject.fork()()) and standard promises (promise.then()).
So I have to discriminate at consume time how to consume the 3 different kind of objects to mix results.
Reasoning about native async/await support, probably a .then method would be a nice interface to implement in any library that can be consumed as promises.
But as you suggest I can add it to Futures myself. So I'm ok with that solution for my project :)
from fluture.
Related Issues (20)
- Error in readme HOT 4
- Can`t realize ap composition HOT 6
- Is it proven that Fluture Future is lawful? HOT 4
- Access computation value as return value HOT 3
- Why does encaseP / attemptP accepts only one parameter? HOT 4
- Event Streams handling HOT 5
- Any future for Fluture on React Native? HOT 4
- chainRej example doesn't include all code needed to replicate
- Consider preserving the specific Error sub-type when converting to Promise HOT 5
- Example Sanctuary integration code throws an error
- Unable to infer types in function passed to `map` HOT 13
- Investigate option for alternative debug api
- Make typings for algebras more strict
- It seams like `Hook (Future e a) b` is equivalent to `ContT a (Future e) b` HOT 1
- Add Future.assume?
- Async Iterators HOT 4
- Using Fluture with Jest HOT 1
- TypeScript error using map HOT 4
- Use result of Future
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluture.