readline-statevar-1.0.1.0: Readline with variables (setX/getY) wrapped in state vars

System.Console.Readline.StateVar

Synopsis

Documentation

readline

Arguments

:: String

prompt

-> IO (Maybe String)

returns the line the user input, or Nothing if EOF is encountered.

readline is similar to System.IO.getLine, but with rich edit functionality and history capability. readline will read a line from the terminal and return it, using prompt as a prompt. If prompt is the empty string, no prompt is issued. The line returned has the final newline removed, so only the text of the line remains. A blank line returns the empty string. If EOF is encountered while reading a line, and the line is empty, Nothing is returned. If an EOF is read with a non-empty line, it is treated as a newline.

addHistory :: String -> IO ()

Add this command to the history. This allows users to search backward through history with C-r and step through with up and down arrows, among other things.

Keymaps

data Keymap

Keymap vars

Callbacks

type Callback = Int -> Char -> IO Int

bindKey :: Char -> Callback -> IO ()

unbindKey :: Char -> IO ()

addUndo :: UndoCode -> Int -> Int -> String -> IO ()

modifying :: Int -> Int -> IO ()

message :: String -> IO ()

deleteText :: Int -> Int -> IO ()

killText :: Int -> Int -> IO ()

callbackHandlerInstall :: String -> (String -> IO ()) -> IO (IO ())