I have following code:
foo x y z | null x = y | null z = y | otherwise = foo (tail x) ([head x] ++ y ++ [head z]) (tail z)
and following i