Some operations to handle the REPL resource configuration file
that is stored in $HOME/.compiler-namerc
readRC
:: CCDescription -> IO [(String, String)]
Reads the rc file. If it is not present, the standard file from the distribution will be copied.
setRCProperty
:: CCDescription -> String -> String -> IO ()
Sets a property in the rc file.
rcValue
:: [(String, String)] -> String -> String
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)])
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)]
Update list of rc properties w.r.t. a list new properties.