tailrecM may also do it, unlike fold it can terminate early
p
tailrecM may also do it, unlike fold it can terminate early