ML-editline is a Standard ML library for adding command-line editing
functionality to Standard ML applications, akin to GNU Readline.
ML-editline does
not link statically to or redistribute any GPL software, however, and
is provided with a permissive MIT license.
Features: readline-like history, arrow keys, simple emacs keybindings
Not features (at least for now): .inputrc handling, vi mode
Platforms: Windows, Cygwin, Linux, MacOS X
Tested terminals: Windows XP console, cygwin, xterm,
xterm-color, and vt100; rxvt does not work in Windows
fun repl () =
case EditLine.readLine ">> " of
NONE => print "good-bye.\n"
| SOME "" => repl ()
| SOME line => (print ("you said: \"" ^ line ^ "\"\n"); repl ());
SML: ML-editline currently only works with the MLton compiler. The implementation makes use of the MLton FFI to access low-level terminal API's in C (included in the download). Future plans include porting these bindings to ML-NLFFI, at which point it should be compatible with Standard ML of New Jersey, or perhaps even eliminating the C code if possible.
C: The Windows native build of miniedit directly uses the Win32 API and should work in all versions of Windows. The Unix build uses ncurses to access the terminfo database.