Added Maybe-related functions; restricted imports from .dcl
[CleanReadLine.git] / ReadLine.icl
index 790db28..4faf3ba 100644 (file)
@@ -4,6 +4,18 @@ import StdEnv
 
 import code from "readLine.o"
 
+//Maybe
+isNothing :: !(Maybe .x) -> Bool
+isNothing Nothing = True
+isNothing _ = False
+
+isJust    :: !(Maybe .x) -> Bool
+isJust Nothing = False
+isJust _ = True
+
+fromJust  :: !(Maybe .x) -> .x
+fromJust (Just x) = x
+
 instance toString HistoryItem where
        toString {line,timestamp} = line +++ " (" +++ timestamp +++ ")"
 instance toString HistoryState where