I would like to modify a .lhs file currently written in plain text. For example, -> would be replaced by → in the .lhs file. I am aware that for display purposes, many text editors can replace these on the display, but I am keen to replace the contents of the file itself. Is there a script that can do this automatically?
yes there is the unilatex.vim plugin (i already disabled the conversion back to latin1 chars) and a haskell prettyfy plugin i merged this haskell.vim from many haskell.vim plugins i found online. In the haskell version the code gets converted back to normal code on saving - but you can just comment out this part. Maybe you have to change a bit of the code to associate the plugins to literate haskell files - i only tried them with plain haskell.
But I don't know if the .lhs file will compile if you change the -> to the arrow.