Haskell tag generation in place