-
-
Save Raynos/a86627f5968d236a78c3 to your computer and use it in GitHub Desktop.
This file contains 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
var intoTuple = curry(_intoTuple) | |
function _intoTuple(size, list, elem) { | |
var lastElem = last(list) | |
if (lastElem && lastElem.length < size) { | |
lastElem.push(elem) | |
} else { | |
list.push([elem]) | |
} | |
return list | |
} |
This file contains 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
var intoTuple = curry(function (size, list, elem) { | |
var lastElem = last(list) | |
if (lastElem && lastElem.length < size) { | |
lastElem.push(elem) | |
} else { | |
list.push([elem]) | |
} | |
return list | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment