Module REPL.RCFile

Author
Michael Hanus
Version
April 2021

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

Exported Functions


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.