Module REPL.Utils

Author
Michael Hanus
Version
September 2024

Some auxiliary operations for the REPL

Exported Functions


showMonoQualTypeExpr :: Bool -> CQualTypeExpr -> String  Deterministic 

Shows an AbstractCurry type expression in standard Curry syntax. If the first argument is True, all occurrences of type variables are replaced by "()".


showMonoTypeExpr :: Bool -> CTypeExpr -> String  Deterministic 

Shows an AbstractCurry type expression in standard Curry syntax. If the first argument is True, all occurrences of type variables are replaced by "()".


moduleNameToPath :: String -> String  Deterministic 

Transforms a hierarchical module identifier into a file path. moduleNameToPath "Data.Set" evaluates to "Data/Set".


validModuleName :: String -> Bool  Deterministic 

Is a string a valid module name?


getTimeCmd :: ReplState -> String -> String -> IO String  Deterministic 


getTimeoutCmd :: ReplState -> String -> IO String  Deterministic 


removeFileIfExists :: String -> IO ()  Deterministic 

Removes the specified file only if it exists.


notNull :: [a] -> Bool  Deterministic 


strip :: String -> String  Deterministic 

Remove leading and trailing whitespace


lpad :: Int -> String -> String  Deterministic 

Extend a String to a given minimal length by adding leading spaces.


rpad :: Int -> String -> String  Deterministic 

Extend a String to a given minimal length by adding trailing spaces.


writeErrorMsg :: String -> IO ()  Deterministic 

Shows an error message.