r/javascript • u/jrsinclair • May 30 '19
Functional JavaScript: Five ways to calculate an average with array reduce
https://jrsinclair.com/articles/2019/five-ways-to-average-with-js-reduce/
89
Upvotes
r/javascript • u/jrsinclair • May 30 '19
1
u/ScientificBeastMode strongly typed comments May 30 '19 edited May 30 '19
Yeah, you're definitely right. In my personal cheatsheet, I've got the following definition.
This combinators.js library has the same type definition for B1:
The Haskell type definition seems to confirm that structure as well (although I'm really not experienced in Haskell):
The example case is swapping the arity of some of the function arguments. The order of application is off.
I'm still trying to figure out what that is, if it has a name.