RAM Machine in haskell