Haskell version of STLC and some refinements