writing compiler in haskell