I can parse ansi escapes in my head now (finally)
joeyh at
Currently writing a function from oldval and newval to an optimal screen output sequence. Ie, currently writing curses.
Except, in curses, the user provided values don't themselves include ansi escape sequences to set colors. They do in my function, which is where a lot of the "fun" will be.
old: foofoofooREDbarbarbarNORMALbaz
new: foofoofooREDxarbarbayNORMALbaz
out: e[9C---->REDxe[7C-->yNORMAL
*System.Console.Regions T> genLineUpdate $ calcLineUpdate (T.pack "\ESC[92mfoofoofoo\ESC[91mbarbarbar\ESC[0mbaz") (T.pack "\ESC[92mfoofoofoo\ESC[91mxarbarbax\ESC[0mbaz")
"\ESC[92m\ESC[91m\ESC[9Cx\ESC[7Cx"
\o/ worked first try!