Godel encoding scheme in Haskell