Module CPM.Config

This module defines the data type for CPM's configuration options, the default values for all options, and functions for reading the user's .cpmrc file and merging its contents into the default options.

Summary of exported operations:

defaultConfig :: Config  Deterministic 
CPM's default configuration values.
showConfiguration :: Config -> String  Deterministic 
Shows the configuration.
showCompilerVersion :: Config -> String  Deterministic 
Shows the compiler version in the configuration.
readConfigurationWith :: [(String,String)] -> ErrorLogger (Either String Config)  Deterministic 
Reads the .cpmrc file from the user's home directory (if present) and merges its contents and some given default settings (first argument) into the configuration used by CPM.

Exported datatypes:


Config

Data type containing the main configuration of CPM.

Constructors:

  • Config :: String -> String -> String -> String -> [String] -> [String] -> String -> String -> (String,Int,Int,Int) -> String -> Config

    Fields:

    • packageInstallDir :: String
    • binInstallDir :: String
    • repositoryDir :: String
    • appPackageDir :: String
    • packageIndexURLs :: [String]
    • packageTarFilesURLs :: [String]
    • homePackageDir :: String
    • curryExec :: String
    • compilerVersion :: (String,Int,Int,Int)
    • compilerBaseVersion :: String

Exported operations:

defaultConfig :: Config  Deterministic 

CPM's default configuration values. These are used if no .cpmrc file is found or a new value for the option is not specified in the .cpmrc file.

showConfiguration :: Config -> String  Deterministic 

Shows the configuration.

showCompilerVersion :: Config -> String  Deterministic 

Shows the compiler version in the configuration.

readConfigurationWith :: [(String,String)] -> ErrorLogger (Either String Config)  Deterministic 

Reads the .cpmrc file from the user's home directory (if present) and merges its contents and some given default settings (first argument) into the configuration used by CPM. Resolves the $HOME variable after merging and creates any missing directories. May return an error using Left.