// trampoline : (thunk -> thunk | value) -> value
// Runs a chain of thunks iteratively so recursion doesn't grow the JS call stack.
// - Start with a "thunk" (a function with no args)
// - While the result is still a function, keep calling it
// - When a non-function value is produced, return it