Closed bergus closed 9 years ago
Well, I think there's a couple things going on here:
Array.from
did until I read about it.Do any of the other builtin types use from
or extract
?
We could also call it coof
if we want to limit collisions :)
Let's hear back from some others and make a decision.
from
is inherited by all Array
subclasses, notably the typed arrays have an own implementation. extract
is nowhere used.
@bergus I named it from
because return
was renamed to of
, and from
seemed to match that convention slightly better. I think that extract
is a good name as well and wouldn't mind seeing it renamed. I didn't realize there was an ES6 collision either, good find!
Can we close this one, or create a PR with suggested fixes?
@SimonRichardson: Done :-) I don't have much experience with Github's online edit interface, so I might have done something odd (please hint me).
Closing, as it's been merged. Congrats!
Thanks @bergus :+1:
I did like the name
extract
that was proposed in #57 much more. Why wasfrom
chosen?To me (and probably most other people who don't know what comonads are about),
extract
is more descriptive and meaningful. Don't we want a self-explanatory spec? It matches the Haskell function as well.Also, I have some reservations against using
from
. The term is used in ES6 for static (constructor) methods to assimilate values in a type, e.g.Array.from
. Don't we expect some collisions, especially sincefrom
originally had a static counterpart (7253b836d86ecc434bcd9775255646b8001fec72)?Sorry for not bringing this up earlier, I seem to have forgotten to watch this repo.