Skip to content

Instantly share code, notes, and snippets.

Avatar

William Dias wdiasvargas

View GitHub Profile
@lubien
lubien / imap-islice.js
Created Jun 24, 2017
Proof of concept of lazy evaluation of map and slices on JavaScript using generators, iterables and iterators. https://repl.it/JAbL/1
View imap-islice.js
/*
* 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
@lubien
lubien / imap.js
Last active Jun 23, 2017
Proof of concept that you can map multiple functions with only one iteration in JavaScript using iterators (like in Python). Run https://repl.it/Izou/2
View imap.js
/*
* 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
@mrosata
mrosata / la-ramda.js
Last active Sep 22, 2022
A subset of the Ramda library written using arrow functions, "lamda-ramda". The purpose of this is fun and to use in environments where importing 3rd party libs isn't allowed. Feel free to add to this.
View la-ramda.js
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