CLM:=clm
-CLMFLAGS:=-nt -l -lreadline
+CLMFLAGS:=-nt -l -lreadline -I $$CLEAN_HOME/lib/clean-platform/OS-Independent -I $$CLEAN_HOME/lib/Generics
LIBRARYDIR:=Clean\ System\ Files
BINARIES:=test
definition module ReadLine
import StdClass
+from Data.Maybe import :: Maybe
-:: Maybe a = Nothing | Just a
:: HistoryItem = {line :: String, timestamp :: String}
:: HistoryState = {entries :: [HistoryItem], offset :: Int, flags :: Int}
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
implementation module ReadLine
import StdEnv
+import Data.Maybe
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