tail recursion even for cached thunk results
introduce maybe type for unfold-right