Module REPL.RCFile

Some operations to handle the REPL resource configuration file that is stored in $HOME/.compiler-namerc

Author: Michael Hanus

Version: April 2021

Summary of exported operations:

readRC :: CCDescription -> IO [(String,String)]  Deterministic 
Reads the rc file.
setRCProperty :: CCDescription -> String -> String -> IO ()  Deterministic 
Sets a property in the rc file.
rcValue :: [(String,String)] -> String -> String  Deterministic 
Look up a configuration variable in the list of variables from the rc file.
extractRCArgs :: [String] -> ([String],[(String,String)])  Deterministic 
Extract from a list of command-line arguments rc properties of the from "-Dprop=val" and return the remaining arguments and the extracted properties.
updateRCDefs :: [(String,String)] -> [(String,String)] -> [(String,String)]  Deterministic 
Update list of rc properties w.r.t.

Exported operations:

readRC :: CCDescription -> IO [(String,String)]  Deterministic 

Reads the rc file. If it is not present, the standard file from the distribution will be copied.

setRCProperty :: CCDescription -> String -> String -> IO ()  Deterministic 

Sets a property in the rc file.

rcValue :: [(String,String)] -> String -> String  Deterministic 

Look up a configuration variable in the list of variables from the rc file. Uppercase/lowercase is ignored for the variable names and the empty string is returned for an undefined variable.

extractRCArgs :: [String] -> ([String],[(String,String)])  Deterministic 

Extract from a list of command-line arguments rc properties of the from "-Dprop=val" and return the remaining arguments and the extracted properties.

updateRCDefs :: [(String,String)] -> [(String,String)] -> [(String,String)]  Deterministic 

Update list of rc properties w.r.t. a list new properties.