This module contains functions to obtain information concerning the current distribution of the Curry implementation, e.g., compiler version, load paths, front end.
Author: Bernd Brassel, Michael Hanus, Bjoern Peemoeller
Version: December 2016
curryCompiler
:: String
The name of the Curry compiler (e.g., "pakcs" or "kics2"). |
curryCompilerMajorVersion
:: Int
The major version number of the Curry compiler. |
curryCompilerMinorVersion
:: Int
The minor version number of the Curry compiler. |
curryRuntime
:: String
The name of the run-time environment (e.g., "sicstus", "swi", or "ghc") |
curryRuntimeMajorVersion
:: Int
The major version number of the Curry run-time environment. |
curryRuntimeMinorVersion
:: Int
The minor version number of the Curry run-time environment. |
installDir
:: String
Path of the main installation directory of the Curry compiler. |
rcFileName
:: IO String
The name of the file specifying configuration parameters of the current distribution. |
rcFileContents
:: IO [(String,String)]
Returns the current configuration parameters of the distribution. |
getRcVar
:: String -> IO (Maybe String)
Look up a specific configuration variable as specified by user in his rc file. |
getRcVars
:: [String] -> IO [Maybe String]
Look up configuration variables as specified by user in his rc file. |
splitModuleFileName
:: String -> String -> (String,String)
Split the FilePath
of a module into the directory prefix and the
FilePath
corresponding to the module name.
|
splitModuleIdentifiers
:: String -> [String]
Split up the components of a module identifier. |
joinModuleIdentifiers
:: [String] -> String
Join the components of a module identifier. |
stripCurrySuffix
:: String -> String
Strips the suffix ".curry" or ".lcurry" from a file name. |
modNameToPath
:: String -> String
Transforms a hierarchical module name into a path name, i.e., replace the dots in the name by directory separator chars. |
currySubdir
:: String
Name of the sub directory where auxiliary files (.fint, .fcy, etc) are stored. |
inCurrySubdir
:: String -> String
Transforms a path to a module name into a file name by adding the currySubDir
to the path and transforming
a hierarchical module name into a path.
|
inCurrySubdirModule
:: String -> String -> String
Transforms a file name by adding the currySubDir to the file name. |
addCurrySubdir
:: String -> String
Transforms a directory name into the name of the corresponding sub directory containing auxiliary files. |
sysLibPath
:: [String]
finding files in correspondence to compiler load path Returns the current path (list of directory names) of the system libraries. |
getLoadPathForModule
:: String -> IO [String]
Returns the current path (list of directory names) that is used for loading modules w.r.t. |
lookupModuleSourceInLoadPath
:: String -> IO (Maybe (String,String))
Returns a directory name and the actual source file name for a module by looking up the module source in the current load path. |
lookupModuleSource
:: [String] -> String -> IO (Maybe (String,String))
Returns a directory name and the actual source file name for a module by looking up the module source in the load path provided as the first argument. |
defaultParams
:: FrontendParams
The default parameters of the front end. |
rcParams
:: IO FrontendParams
The default parameters of the front end as configured by the compiler specific resource configuration file. |
setQuiet
:: Bool -> FrontendParams -> FrontendParams
Set quiet mode of the front end. |
setExtended
:: Bool -> FrontendParams -> FrontendParams
Set extended mode of the front end. |
setOverlapWarn
:: Bool -> FrontendParams -> FrontendParams
Set overlap warn mode of the front end. |
setFullPath
:: [String] -> FrontendParams -> FrontendParams
Set the full path of the front end. |
setHtmlDir
:: String -> FrontendParams -> FrontendParams
Set the htmldir parameter of the front end. |
setLogfile
:: String -> FrontendParams -> FrontendParams
Set the logfile parameter of the front end. |
setSpecials
:: String -> FrontendParams -> FrontendParams
Set additional specials parameters of the front end. |
addTarget
:: FrontendTarget -> FrontendParams -> FrontendParams
Add an additional front end target. |
quiet
:: FrontendParams -> Bool
Returns the value of the "quiet" parameter. |
extended
:: FrontendParams -> Bool
Returns the value of the "extended" parameter. |
overlapWarn
:: FrontendParams -> Bool
Returns the value of the "overlapWarn" parameter. |
fullPath
:: FrontendParams -> Maybe [String]
Returns the full path parameter of the front end. |
htmldir
:: FrontendParams -> Maybe String
Returns the htmldir parameter of the front end. |
logfile
:: FrontendParams -> Maybe String
Returns the logfile parameter of the front end. |
specials
:: FrontendParams -> String
Returns the special parameters of the front end. |
callFrontend
:: FrontendTarget -> String -> IO ()
In order to make sure that compiler generated files (like .fcy, .fint, .acy) are up to date, one can call the front end of the Curry compiler with this action. |
callFrontendWithParams
:: FrontendTarget -> FrontendParams -> String -> IO ()
In order to make sure that compiler generated files (like .fcy, .fint, .acy) are up to date, one can call the front end of the Curry compiler with this action where various parameters can be set. |
Data type for representing the different target files that can be produced by the front end of the Curry compiler.
Constructors:
FCY
:: FrontendTarget
: FlatCurry file ending with .fcy
FINT
:: FrontendTarget
: FlatCurry interface file ending with .fint
ACY
:: FrontendTarget
: AbstractCurry file ending with .acy
UACY
:: FrontendTarget
: Untyped (without type checking) AbstractCurry file ending with .uacy
HTML
:: FrontendTarget
: colored HTML representation of source program
CY
:: FrontendTarget
: source representation employed by the frontend
TOKS
:: FrontendTarget
: token stream of source program
Abstract data type for representing parameters supported by the front end of the Curry compiler.
Constructors:
The name of the Curry compiler (e.g., "pakcs" or "kics2").
|
The major version number of the Curry compiler.
|
The minor version number of the Curry compiler.
|
The name of the run-time environment (e.g., "sicstus", "swi", or "ghc")
|
The major version number of the Curry run-time environment.
|
The minor version number of the Curry run-time environment.
|
Path of the main installation directory of the Curry compiler.
|
The name of the file specifying configuration parameters of the current distribution. This file must have the usual format of property files (see description in module PropertyFile). |
Returns the current configuration parameters of the distribution. This action yields the list of pairs (var,val). |
Look up a specific configuration variable as specified by user in his rc file. Uppercase/lowercase is ignored for the variable names. |
Look up configuration variables as specified by user in his rc file. Uppercase/lowercase is ignored for the variable names. |
Split the |
Split up the components of a module identifier. For instance,
|
Join the components of a module identifier. For instance,
|
Strips the suffix ".curry" or ".lcurry" from a file name. |
Transforms a hierarchical module name into a path name, i.e., replace the dots in the name by directory separator chars. |
Name of the sub directory where auxiliary files (.fint, .fcy, etc) are stored.
|
Transforms a path to a module name into a file name
by adding the |
Transforms a file name by adding the currySubDir to the file name. This version respects hierarchical module names. |
Transforms a directory name into the name of the corresponding sub directory containing auxiliary files. |
finding files in correspondence to compiler load path Returns the current path (list of directory names) of the system libraries. |
Returns the current path (list of directory names) that is used for loading modules w.r.t. a given module path. The directory prefix of the module path (or "." if there is no such prefix) is the first element of the load path and the remaining elements are determined by the environment variable CURRYRPATH and the entry "libraries" of the system's rc file. |
Returns a directory name and the actual source file name for a module by looking up the module source in the current load path. If the module is hierarchical, the directory is the top directory of the hierarchy. Returns Nothing if there is no corresponding source file. |
Returns a directory name and the actual source file name for a module by looking up the module source in the load path provided as the first argument. If the module is hierarchical, the directory is the top directory of the hierarchy. Returns Nothing if there is no corresponding source file. |
The default parameters of the front end.
|
The default parameters of the front end as configured by the compiler specific resource configuration file. |
Set quiet mode of the front end.
|
Set extended mode of the front end.
|
Set overlap warn mode of the front end.
|
Set the full path of the front end. If this parameter is set, the front end searches all modules in this path (instead of using the default path).
|
Set the htmldir parameter of the front end. Relevant for HTML generation.
|
Set the logfile parameter of the front end. If this parameter is set, all messages produced by the front end are stored in this file.
|
Set additional specials parameters of the front end. These parameters are specific for the current front end and should be used with care, since their form might change in the future.
|
Add an additional front end target.
|
Returns the value of the "quiet" parameter.
|
Returns the value of the "extended" parameter.
|
Returns the value of the "overlapWarn" parameter.
|
Returns the full path parameter of the front end.
|
Returns the htmldir parameter of the front end.
|
Returns the logfile parameter of the front end.
|
Returns the special parameters of the front end.
|
In order to make sure that compiler generated files (like .fcy, .fint, .acy) are up to date, one can call the front end of the Curry compiler with this action. If the front end returns with an error, an exception is raised.
|
In order to make sure that compiler generated files (like .fcy, .fint, .acy) are up to date, one can call the front end of the Curry compiler with this action where various parameters can be set. If the front end returns with an error, an exception is raised.
|