compute-io / polynomial

Evaluates a polynomial.
MIT License
7 stars 1 forks source link

Allow partial application / currying #2

Open Planeshifter opened 9 years ago

Planeshifter commented 9 years ago

Would be great if one could simply call polyval( coef ) and get a new function back with the specified coefficients. Although one can do this simply by using the .bind() method, I believe this would be more convenient and natural.

kgryte commented 9 years ago

Yes, this seems reasonable. I would probably opt for an exported factory method (for inspiration, see dstructs-ndarray). I would like to avoid .bind, as this is a perf killer.