Haskell implementation of sed