[Haskell] memory management