better haskell handling