These are chat archives for ramda/ramda

Feb 2015
Feb 02 2015 03:23 UTC
lol @ "No lists have been harmed in the application of this function."
Jethro Larson
Feb 02 2015 07:02 UTC
Messages here are in github flavored markdown if you want to lookup the options.
Scott Sauyet
Feb 02 2015 14:59 UTC
nAry and arity are very similar. They both wrap your function in one of length n. But nAry only passes along n arguments. arity passes along as many as you supply. nAry is especially useful for when you want to restrict a function that accepts optional parameters to instead ignore them. Think of the radix parameter to parseInt being entangled with the index parameter supplied by -- one good exaple of the reason we don't supply such a parameter in -- which could be overcome with nAry: ['1', '2', '3'].map(nAry(1, parseInt)) (obviously, not the easiest fix for the issue!). arity, on the other hand, simply makes it easier to report the length properly, even though the function might use the arguments object rather than named parameters. It expecially helps with currying functions that don't have a specified length, although you don't have to call it directly there, since curryN calls it for you.