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.

Exported Datatypes


data 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 : The directory where locally installed packages are stored
    • binInstallDir :: String : The directory where executable of locally installed packages are stored
    • repositoryDir :: String : Directory where the package repository is stored
    • appPackageDir :: String : Directory where the application packages are stored (cmd install)
    • packageIndexURLs :: [String] : URLs tried for downloading the package index
    • packageTarFilesURLs :: [String] : URL prefixes to the directory containing tar files of all packages
    • homePackageDir :: String : The directory where the default home package is stored
    • curryExec :: String : The executable of the Curry system used to compile and check packages
    • compilerVersion :: (String, Int, Int, Int) : The compiler version (name,major,minor,rev) used to compile packages
    • compilerBaseVersion :: String : The version of the base libraries used by the compiler

Exported Functions


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.