Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created July 24, 2012 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynos/a86627f5968d236a78c3 to your computer and use it in GitHub Desktop.
Save Raynos/a86627f5968d236a78c3 to your computer and use it in GitHub Desktop.
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
}
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