Comments (3)
However I will mantain the methods having two ways to operate with iterables. I mean:
Iterum([1, 2, 3]).map(e => 2 * e) // method style
Iterum.map(e => 2 * e, [1, 2, 3]) // functional style
from iterum.
This change produce some inconvenients for binary iterable functions like concat
and zip
.
For the almost functions we have this rule:
Iterum(iterable).map(cb) === Iterum.map(cb, iterable)
Iterum(iterable).reduce(cb, initial) === Iterum.reduce(cb, initial, iterable)
Iterum(iterable).padEnd(length, value) === Iterum.padEnd(length, value, iterable)
But if this rule is extrapolated to zip
function we have:
Iterum(firstIterable).zip(secondIterable) === Iterum.zip(secondIterable, firstIterable)
Then Iterum.zip([1, 2], [3, 4])
returns
[
[3, 1],
[4, 2]
]
But it's not the intuitive result. Then, I should think more how to handle this type of functions.
from iterum.
Fixed!
from iterum.
Related Issues (20)
- Implement lazy cartesian product HOT 3
- implement `power` method
- implement `combinations` method HOT 1
- Removing optional arguments in methods. HOT 4
- removing forEach method
- removing `fromIndex` arguments. HOT 2
- Implement `has` & `nth` methods
- Add benchmarks HOT 4
- permutations method must work with infinite iterables
- remove default behaviour of Iterum functions if first parameter is not an iterable.
- currying functions
- add powerset method and function
- add variations (k-permutations) method and function
- implement zipLongest & transposeLongest
- implement `tap`
- implement chunk
- implement toString
- Implement cycle
- adapt indexOf to use sameValueZero specification for equality
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 iterum.