Added Maybe-related functions; restricted imports from .dcl
[CleanReadLine.git] / ReadLine.dcl
index f859e32..7828e88 100644 (file)
@@ -1,6 +1,6 @@
 definition module ReadLine
 
-import StdEnv
+import StdClass
 
 :: Maybe a = Nothing | Just a
 :: HistoryItem = {line :: String, timestamp :: String}
@@ -9,8 +9,13 @@ import StdEnv
 instance toString HistoryItem
 instance toString HistoryState
 
+//Maybe functions
+isNothing :: !(Maybe .x) -> Bool
+isJust    :: !(Maybe .x) -> Bool
+fromJust  :: !(Maybe .x) -> .x
+
 //Non-library functions
-setReadLineName :: !String !*env -> !*env
+setReadLineName :: !String !*env -> *env
 
 //Readline
 readLine :: !String !Bool !*env -> (!Maybe String, !*env)
@@ -18,18 +23,18 @@ readLine :: !String !Bool !*env -> (!Maybe String, !*env)
 //Initializing History and State Management
 //Note that this HAS to be executed when you want to add entries when the
 //history has not been used
-usingHistory :: !*env -> !*env
+usingHistory :: !*env -> *env
 historyGetHistoryState :: !*env -> (!HistoryState, !*env)
-historySetHistoryState :: !HistoryState !*env -> !*env
+historySetHistoryState :: !HistoryState !*env -> *env
 
 //History List Management
-addHistory :: !String !*env -> !*env
-addHistoryTime :: !String !*env -> !*env
+addHistory :: !String !*env -> *env
+addHistoryTime :: !String !*env -> *env
 removeHistory :: !Int !*env -> (!HistoryItem, !*env)
 replaceHistoryEntry :: !Int !String !*env -> (!HistoryItem, !*env)
-clearHistory :: !*env -> !*env
-stifleHistory :: !Int !*env -> !*env
-unstifleHistory :: !*env -> !*env
+clearHistory :: !*env -> *env
+stifleHistory :: !Int !*env -> *env
+unstifleHistory :: !*env -> *env
 historyIsStifled :: !*env -> (!Int, !*env)
 
 //Information About the History List