8.4. The Readline interface

(Darren Moffat supplied the Readline interface.)

The Readline module is a straightforward interface to the GNU Readline library. As such, you will need to look at the GNU documentation (and have a libreadline.a file around somewhere…)

You'll need to link any Readlining program with -lreadline -ltermcap, besides the usual -syslib ghc (and -fhaskell-1.3).

The main function you'll use is:
readline :: String{-the prompt-} -> IO String

If you want to mess around with Full Readline G(l)ory, we also provide:
rlInitialize, addHistory,

rlBindKey, rlAddDefun, RlCallbackFunction(..),

rlGetLineBuffer, rlSetLineBuffer, rlGetPoint, rlSetPoint, rlGetEnd,
rlSetEnd, rlGetMark, rlSetMark, rlSetDone, rlPendingInput,

rlPrompt, rlTerminalName, rlSetReadlineName, rlGetReadlineName
(All those names are just Haskellised versions of what you will see in the GNU readline documentation.)