let rec funny f n = if n = 0 then id else if n mod 2 = 0 then funny (f $ f) (n / 2) else funny (f $ f) (n / 2) $ f;;