Merged haskeline patch from John Wiegley

(merged by hand because it was submitted to a repository with different history)
Fixed a state-serialization format breakage in Seen
slight improvement to error message for empty @do...

... and other simple code-mangling commands