Manual merge from git.haskell.org/packages/haskeline.git Original patch by Ian Lynagh <ian@well-typed.com>