Comment on Recursion, Tail Calls and Trampolines in JavaScript (2015)Comments−bad_user8yIn case you need a trampoline, it's more comfortable to use a well grown data type. Here's mine ...Eval, a data-type for handling synchronous evaluation: https://funfix.org/api/effect/classes/eval.htmlIO, a data-type for suspending side effects, including asynchronous ones, an FP/lawful replacement for Promise; ported from Haskell, but better: https://funfix.org/api/effect/classes/io.htmlAlso note that Promise's implementation leaks memory in "then" chains, so be cautious when using Promises to work around JavaScript's call-stack — https://alexn.org/blog/2017/10/11/javascript-promise-leaks-m...−chrisseaton8yuse a well grown data typeWhat does 'well grown' mean in the context of data types?−bad_user8yLawful.−chrisseaton8yI've heard of lawful but never 'well grown' - where does the term come from?
Comments
In case you need a trampoline, it's more comfortable to use a well grown data type. Here's mine ...
Eval, a data-type for handling synchronous evaluation: https://funfix.org/api/effect/classes/eval.html
IO, a data-type for suspending side effects, including asynchronous ones, an FP/lawful replacement for Promise; ported from Haskell, but better: https://funfix.org/api/effect/classes/io.html
Also note that Promise's implementation leaks memory in "then" chains, so be cautious when using Promises to work around JavaScript's call-stack — https://alexn.org/blog/2017/10/11/javascript-promise-leaks-m...
What does 'well grown' mean in the context of data types?
Lawful.
I've heard of lawful but never 'well grown' - where does the term come from?