This module contains operations related to module names and paths used in Curry system.
Author: Bernd Brassel, Michael Hanus, Bjoern Peemoeller, Finn Teegen
Version: December 2018
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. |
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
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. |