Manual merge from git.haskell.org/packages/haskeline.git Original patch by Edward Z. Yang <ezyang@mit.edu>