[Haskell] integration of functional and imperative programming concepts