1 definition module ReadLine
5 :: Maybe a = Nothing | Just a
6 :: HistoryItem = {line :: String, timestamp :: String}
7 :: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int}
9 instance toString HistoryItem
10 instance toString HistoryState
13 isNothing :: !(Maybe .x) -> Bool
14 isJust :: !(Maybe .x) -> Bool
15 fromJust :: !(Maybe .x) -> .x
17 //Non-library functions
18 setReadLineName :: !String !*env -> *env
21 readLine :: !String !Bool !*env -> (!Maybe String, !*env)
23 //Initializing History and State Management
24 usingHistory :: !*env -> *env
25 historyGetHistoryState :: !*env -> (!HistoryState, !*env)
26 historySetHistoryState :: !HistoryState !*env -> *env
28 //History List Management
29 addHistory :: !String !*env -> *env
30 addHistoryTime :: !String !*env -> *env
31 removeHistory :: !Int !*env -> (!HistoryItem, !*env)
32 replaceHistoryEntry :: !Int !String !*env -> (!HistoryItem, !*env)
33 clearHistory :: !*env -> *env
34 stifleHistory :: !Int !*env -> *env
35 unstifleHistory :: !*env -> *env
36 historyIsStifled :: !*env -> (!Int, !*env)
38 //Information About the History List
39 historyList :: !*env -> (![HistoryItem], !*env)
40 whereHistory :: !*env -> (!Int, !*env)
41 currentHistory :: !*env -> (!Maybe HistoryItem, !*env)
42 historyGet :: !Int !*env -> (!Maybe HistoryItem, !*env)
43 historyGetTime :: HistoryItem -> String
44 historyTotalBytes :: !*env -> (!Int, !*env)
46 //Moving Around the History List
47 historySetPos :: !Int !*env -> (!Int, !*env)
48 previousHistory :: !*env -> (!Maybe HistoryItem, !*env)
49 nextHistory :: !*env -> (!Maybe HistoryItem, !*env)
51 //Searching the History List
52 historySearch :: !String !Int !*env-> (!Int, !*env)
53 historySearchPrefix :: !String !Int !*env-> (!Int, !*env)
54 historySearchPos :: !String !Int !Int !*env-> (!Int, !*env)
56 //Managing the History File
57 readHistory :: !String !*env -> (!Bool, !*env)
58 readHistoryRange :: !String !Int !Int !*env -> (!Bool, !*env)
59 writeHistory :: !String !*env -> (!Bool, !*env)
60 appendHistory :: !Int !String !*env -> (!Bool, !*env)
61 historyTruncateFile :: !String !Int !*env -> (!Bool, !*env)
64 historyExpand :: !String !*env -> (!String, !Int, !*env)
65 getHistoryEvent :: !String !Int !Int !*env -> (!Maybe String, !Int, !*env)
66 historyTokenize :: !String !*env -> ([String], !*env)
67 historyArgExtract :: !Int !Int !String !*env -> (!Maybe String, !*env)