"by decoupling how a function recurses over data from what the function actually does" second read at same phrase and need 10 more times. THANKS @importantshock@FLJSbook#fp @javascript_fan
“... partial application is strictly a reduction in a function’s arity;”
—@getify, #fljsbook
And, generally speaking, less arity is better. Generally. Do what you gotta when you gotta, but know there are a number of ways to address and refactor function calls with high arity.
Both QIO and cofx look related and interesting. Appreciate you sharing. Not clear that Monio merely duplicates them (I think there are reasons for Monio to still exist), but I do think I should probably cite them in Monio's docs as relevant adjacent work.
Thanks to @ajchambeaud I found the library I was talking about: github.com/neurosnap/cofx. Same idea of the other one I found, but this uses generators as a way of making the code more "imperative/doblocky"
I do love making monads more approachable, but conflating terms leads to confusion. Something with map, fold, concat, etc does not necessarily mean it’s a monad. And that is what I took you as claiming.
“... we should aspire to be able to understand our code well enough that we know the test suite will pass before it runs.”
— @getify, Functional-Light JavaScript
leanpub.com/fljs#FLJSbook
As for "best practice" i.e. efficiency, using tail calls ( TCO) can help with really deep recursion but also don't forget to consider the "human efficiency" of how long it takes you to read/write the code! Sometimes iterative code is the clearer & faster choice 🙂
so my advice would be: try normal recursion first, then apply a trampoline. I would advocate PTC form except that nobody but Webkit supports, so it's not that useful yet.
Just finished @FLJSbook and thought it was a good introduction to Functional Programming concepts. It was a little heady at times but still a good read overall. I still don't know what a monad is.