main(x) = half(x)

half(x) = t where (s,t) = h(x)
h(S(x)) = (S(t),s) where (s,t) = h(x)
h(Z)    = (Z,Z)
