This module contains operations related to module names and paths used in Curry system.
Author: Bernd Brassel, Michael Hanus, Bjoern Peemoeller, Finn Teegen
Version: March 2024
splitProgramName
:: String -> (String,String)
Splits a program name, i.e., a module name possibly prefixed by a directory, into the directory and the module name. |
splitValidProgramName
:: String -> (String,String)
Splits a program name, i.e., a module name possibly prefixed by a directory, into the directory and a valid module name. |
isValidModuleName
:: String -> Bool
Is the given string a valid module name? |
runModuleAction
:: (String -> IO a) -> String -> IO a
Executes an I/O action, which is parameterized over a module name, for a given program name. |
runModuleActionQuiet
:: (String -> IO a) -> String -> IO a
Executes an I/O action, which is parameterized over a module name, for a given program name. |
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 result of 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 given module name (where a possible curry
suffix is stripped off)
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 given module name (where a possible curry
suffix is stripped off)
by looking up the module source in the load path provided as the
first argument.
|
curryModulesInDirectory
:: String -> IO [String]
Gets the names of all Curry modules contained in a given directory. |
curryrcFileName
:: IO String
The name of the file specifying resource configuration parameters of the current distribution. |
setCurryPath
:: Bool -> String -> IO ()
If the environment variable CURRYPATH
is not already set
(i.e., not null), set it to the value computed by cypm deps --path
in order to allow invoking tools without cypm exec ... .
|
Functions for handling file names of Curry modules
Type synonym: ModuleIdent = String
A module path consists of a directory prefix (which can be omitted) and a module name (which can be hierarchical). For instance, the following strings are module paths in Unix-based systems:
HTML Data.Number.Int curry/Data.Number.Int
Type synonym: ModulePath = String
Splits a program name, i.e., a module name possibly prefixed by
a directory, into the directory and the module name.
A possible suffix like |
Splits a program name, i.e., a module name possibly prefixed by
a directory, into the directory and a valid
module name.
A possible suffix like |
Is the given string a valid module name? |
Executes an I/O action, which is parameterized over a module name,
for a given program name. If the program name is prefixed by a directory,
switch to this directory before executing the action, report
this switch on stdout, and switch back after the action.
A possible suffix like |
Executes an I/O action, which is parameterized over a module name,
for a given program name. If the program name is prefixed by a directory,
switch to this directory before executing the action and switch
back after the action.
A possible suffix like |
Split the |
Split up the components of a module identifier. For instance,
|
Join the components of a module identifier. For instance,
|
Strips the suffix |
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. Note that the name of this directory depends
on the compiler to avoid confusion when using different compilers.
For instance, when using PAKCS 3.2.0, |
Transforms a path to a module name into a file name
by adding the result of currySubDir
to the path and transforming
a hierarchical module name into a path.
For instance, when using PAKCS 3.2.0, |
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 given module name (where a possible |
Returns a directory name and the actual source file name for
a given module name (where a possible |
Gets the names of all Curry modules contained in a given directory. Modules in subdirectories are returned as hierarchical module names. |
The name of the file specifying resource configuration parameters of the current distribution. This file must have the usual format of property files. |
If the environment variable |