Comments (11)
chain seems to be used since the last 10 month in fantasyland. Personally, I prefer to have a common vocabulary even if I do start to like flatMap. But personal preference is not likely to be the choice of the community.
I don't know when the status on TC39 did change, or move and if this is stable.
from most.
As of #14 it's been switched to chain
, but I still don't think there's a clear winner. Fantasy-land still uses chain
, while similar projects, such as Bacon.js and RxJS use flatMap
.
from most.
flatMap seems better to me
On Mon, Jul 21, 2014 at 4:45 PM, Brian Cavalier [email protected]
wrote:
As of #14 #14 it's been switched to
chain, but I still don't think there's a clear winner. Fantasy-land still
uses chain, while similar projects, such as Bacon.js and RxJS use flatMap.—
Reply to this email directly or view it on GitHub
#13 (comment).
Best regards,
┏( ^◡^)┛ ┗(^◡^ )┓ I rock RaveJS! ┏( ^◡^)┛ ┗(^◡^ )┓
http://rivieragug.org/
http://3musket33rs.github.com/
http://fabricematrat.github.io/
from most.
I prefer flatMap
too. Should we provide both as aliases?
from most.
Sure !
On Jul 21, 2014 4:53 PM, "Brian Cavalier" [email protected] wrote:
I prefer flatMap too. Should we provide both as aliases?
—
Reply to this email directly or view it on GitHub
#13 (comment).
from most.
👍 for alias.
from most.
I've become averse to "do both", but in this case, it's just not clear what is the right criteria for choosing:
chain
Pros
- Used by fantasy-land
- Nice, short name
- Conceptually, monads provide sequencing for functional operations, hence the name "chain" makes sense: chaining computations together.
Cons:
- Not as immediately obvious what it does to anyone not familiar with monads
- Not used by as many other libs/languages. "oh, I see now, it's kinda like flatMap?"
flatMap
Pros
* Used by more other libs: Bacon.js, RxJS, Scala, other reactive libs in other languages
* Slightly more obvious what it does, at least in the list/sequence/stream domain. Nice contrast with .map
Cons
* Uglier to type?
Others?
Here's a thought: Designate flatMap
as the primary API, and chain
as the "fantasy-land compatibility" alias?
from most.
I would agree chain/flatMap is about composition but typing flatMap is not
ugly it relates to the map. It's also relating to the type of chaining you
want to apply. Chaining in a flatMap style. Chain seems more general but
here it's really a flatMap method like in other language. In other hands JS
Frw seems also to like chain like lodash for example but is it the same
principle ?
On Mon, Jul 21, 2014 at 5:17 PM, Brian Cavalier [email protected]
wrote:
I've become averse to "do both", but in this case, it's just not clear
what is the right criteria for choosing:
chainPros
- Used by fantasy-land
- Nice, short name
- Conceptually, monads provide sequencing for functional operations,
hence the name "chain" makes sense: chaining computations together.Cons:
- Not as immediately obvious what it does to anyone not familiar with
monads- Not used by as many other libs/languages. "oh, I see now, it's kinda
like flatMap?"flatMap
Pros
- Used by more other libs: Bacon.js, RxJS, Scala, other reactive libs in
other languages- Slightly more obvious what it does, at least in the list/sequence/stream
domain. Nice contrast with .mapCons
- Uglier to type?
Others?
Here's a thought: Designate flatMap as the primary API, and chain as the
"fantasy-land compatibility" alias?—
Reply to this email directly or view it on GitHub
#13 (comment).
Best regards,
┏( ^◡^)┛ ┗(^◡^ )┓ I rock RaveJS! ┏( ^◡^)┛ ┗(^◡^ )┓
http://rivieragug.org/
http://3musket33rs.github.com/
http://fabricematrat.github.io/
from most.
In other hands JS Frw seems also to like chain like lodash for example but is it the same
principle ?
Good point, "chain" has different connotations in other libraries, like lodash as you mentioned. In lodash, _.chain
is not flatMap
What do you think about the idea above to document flatMap
as the primary API, and chain
as the fantasy-land compatibility alias?
from most.
Ok, flatMap
and chain
are now aliases.
from most.
This doesn't seem documented yet. See pull/95
from most.
Related Issues (20)
- How to test delayed observables? HOT 1
- Debounce repeats last emission at completion HOT 9
- Proposal: Grammatical Typology to Enable Advanced Tooling HOT 3
- RemoveEventListener when using fromEvent HOT 3
- How to write a transducer? HOT 10
- Have you considered testing static pipelines as well in the perf tests? HOT 2
- awaitPromise() chain should have an timeout failure report option HOT 7
- Update the Perf Test readme
- Speed when using DOM compared to virtual DOM HOT 5
- Benchmark against Flyd HOT 3
- Just want to share most-koans I've built like 3 of years ago HOT 3
- fromPromise is not disposed correctly HOT 5
- Typescript: Bad function signature for .sample().
- Claiming support for "asynchronous generators" creates confusion
- adding Solid.js into the perf comparison HOT 2
- Clarify currently recommended version of Most
- good for dataflow graphs? HOT 1
- Wrong typescript type for $.ap() HOT 2
- Side-effect at end of stream HOT 1
- What happened to mostjs? HOT 1
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 most.