This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* imap lazily maps an interable. | |
* @param ref Either an iterable or an iterator | |
* @param fn Map function | |
* | |
* It works by always returning a new iterator so that | |
* you can chain other imaps without looping once more | |
* over the same array! | |
* | |
* Since iterators are returned, to start the real mapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* imap lazily maps an interable. | |
* @param fn Map function | |
* @param iterableOrIterator Either an iterable or an iterator | |
* | |
* It works by always returning a new iterator so that | |
* you can chain other imaps without loopin once more | |
* over the same array! | |
* | |
* Since iterables are returned, to start the real mapping |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const R = new LaRamda() | |
/** | |
* A subset of custom implementations of functions from | |
* the Ramda library. (all in Lamda form) | |
* - thanks to @xgrommx for uniq, intersection, where, evolve, | |
* applySpec, defaultTo, both, either, cond, zipWith | |
*/ | |
function LaRamda () { | |
const I = x => x |