tail recursion in ruby. equivalent : .py
usage of higher-order functions in ruby.
equivalent to .py.
PE1, higher order functions with haskell.
not sure this is the best solution with hof.