[Haskell-beginners] Re: Tab complement

Benjamin L.Russell DekuDekuplex at Yahoo.com
Thu Nov 6 06:39:30 EST 2008


On Thu, 6 Nov 2008 18:38:55 +0800, "gerry xiao" <gerryxiao at gmail.com>
wrote:

>Hello,i'm gerry,new to haskell
>
>Why i can't do tab complement in GHCI?

In GHC 6.10.1, editline is used for input (see "1.4. Release notes for
version 6.10.1" at
http://haskell.org/ghc/docs/6.10.1/html/users_guide/release-6-10-1.html,
under "1.4.4. GHCi changes").

Editline provides certain useful command line editing features, such
as command history and line editing, but not tab completion.

For tab completion, one possibility that might work is to try out
rlwrap (see "rlwrap" at
http://utopia.knoware.nl/~hlub/rlwrap/man.html).  Rlwrap is a readline
wrapper that intercepts user input, providing line editing, persistent
history, and completion.  While readline was replaced by editline in
GHC 6.10.1, it might be possible to wrap the editline in GHCi with an
rlwrap wrapper for readline wrapping GHCi in the following manner at
the command prompt:

$ rlwrap ghci

See "rlwrap, Emacs midi-input and p5httpd" at
http://utopia.knoware.nl/~hlub/rlwrap/ for information on compiling
and running rlwrap, which requires "[a] newer (4.2+) GNU readline and
an ANSI C compiler."

Please note that using rlwrap would be experimental, since you would
essentially be wrapping the editline replacing readline in GHCi with
an rlwrap wrapping readline wrapping GHCi in the shell.

Please post your results in this thread, since it would be useful to
learn if this would work.

-- Benjamin L. Russell



More information about the Beginners mailing list