I ran across an Erlang fun that could recursively calculate exponentials and it was very perplexing at first.
|
This is double the fun from what I am used to seeing. The outer fun constructs another fun that is designed to take itself as a parameter. Mind blown!
After looking this over for a bit I realized it wasn’t tail-call optimized so after a couple stabs I took it to the next level.
|