Module Analysis.Files

This module contains operations to load and store analysis information persistently in files.

Author: Heiko Hoffmann, Michael Hanus

Version: September 2023

Summary of exported operations:

getAnalysisBaseFile :: String -> String -> IO String  Deterministic 
Get the file name in which analysis results are stored (without suffix ".pub" or ".priv")
getAnalysisPublicFile :: String -> String -> IO String  Deterministic 
Get the file name in which public analysis results are stored.
getAnalysisDirectory :: IO String  Deterministic 
getInterfaceInfos :: Read a => DLevel -> String -> [String] -> IO (ProgInfo a)  Deterministic 
loadDefaultAnalysisValues :: Read a => DLevel -> String -> String -> IO [((String,String),a)]  Deterministic 
Gets the file name in which default analysis values different from standard start values are stored.
loadCompleteAnalysis :: Read a => DLevel -> String -> String -> IO (ProgInfo a)  Deterministic 
Loads the currently stored analysis information for a module.
loadPublicAnalysis :: Read a => DLevel -> String -> String -> IO (ProgInfo a)  Deterministic 
Reads analysis result from file for the public entities of a given module.
storeImportModuleList :: DLevel -> String -> [String] -> IO ()  Deterministic 
Store current import dependencies.
getImportModuleListFile :: String -> IO (Maybe String)  Deterministic 
Gets the file containing import dependencies for a main module (if it exists).
storeAnalysisResult :: Show a => DLevel -> String -> String -> ProgInfo a -> IO ()  Deterministic 
Store an analysis results in a file and create directories if neccesssary.
createDirectoryR :: DLevel -> String -> IO ()  Deterministic 
deleteAllAnalysisFiles :: String -> IO ()  Deterministic 
Deletes all analysis files for a given analysis name.
findModuleSourceInLoadPath :: String -> IO (String,String)  Deterministic 
Returns a directory name and the actual source file name for a module by looking up the module source in the current load path.
getImports :: DLevel -> String -> IO [String]  Non-deterministic 
Get the imports of a module.
getSourceFileTime :: String -> IO (String,ClockTime)  Deterministic 
getFlatCurryFileTime :: String -> IO (String,Maybe ClockTime)  Deterministic 
flatCurryFileNewer :: String -> IO (Maybe String)  Deterministic 
Returns name of the FlatCurry file of a module if this file exists and is newer than the source file.
readNewestFlatCurry :: String -> IO Prog  Non-deterministic 
Returns the newest FlatCurry program for a module.
readNewestFlatCurryInt :: String -> IO Prog  Non-deterministic 
Returns the newest FlatCurry interface for a module.
flat2intName :: String -> String  Deterministic 
Translates FlatCurry file name to corresponding FlatCurry interface file name.

Exported operations:

getAnalysisBaseFile :: String -> String -> IO String  Deterministic 

Get the file name in which analysis results are stored (without suffix ".pub" or ".priv")

getAnalysisPublicFile :: String -> String -> IO String  Deterministic 

Get the file name in which public analysis results are stored.

getAnalysisDirectory :: IO String  Deterministic 

getInterfaceInfos :: Read a => DLevel -> String -> [String] -> IO (ProgInfo a)  Deterministic 

loadDefaultAnalysisValues :: Read a => DLevel -> String -> String -> IO [((String,String),a)]  Deterministic 

Gets the file name in which default analysis values different from standard start values are stored. Typically, such a file contains specific analysis information for external operations. The file must contain a term of the type [(String,a)] where the first component of each pair is the name of the operation (it is assumed that this denotes an operation of the current module) and the second component is an analysis value.

loadCompleteAnalysis :: Read a => DLevel -> String -> String -> IO (ProgInfo a)  Deterministic 

Loads the currently stored analysis information for a module.

loadPublicAnalysis :: Read a => DLevel -> String -> String -> IO (ProgInfo a)  Deterministic 

Reads analysis result from file for the public entities of a given module.

storeImportModuleList :: DLevel -> String -> [String] -> IO ()  Deterministic 

Store current import dependencies.

getImportModuleListFile :: String -> IO (Maybe String)  Deterministic 

Gets the file containing import dependencies for a main module (if it exists).

storeAnalysisResult :: Show a => DLevel -> String -> String -> ProgInfo a -> IO ()  Deterministic 

Store an analysis results in a file and create directories if neccesssary. The first argument is the analysis name.

createDirectoryR :: DLevel -> String -> IO ()  Deterministic 

deleteAllAnalysisFiles :: String -> IO ()  Deterministic 

Deletes all analysis files for a given analysis name.

findModuleSourceInLoadPath :: String -> IO (String,String)  Deterministic 

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. An error is raised if there is no corresponding source file.

getImports :: DLevel -> String -> IO [String]  Non-deterministic 

Get the imports of a module.

getSourceFileTime :: String -> IO (String,ClockTime)  Deterministic 

getFlatCurryFileTime :: String -> IO (String,Maybe ClockTime)  Deterministic 

flatCurryFileNewer :: String -> IO (Maybe String)  Deterministic 

Returns name of the FlatCurry file of a module if this file exists and is newer than the source file.

readNewestFlatCurry :: String -> IO Prog  Non-deterministic 

Returns the newest FlatCurry program for a module. The source program is parsed if the interface older than the source, otherwise the FlatCurry program is read without parsing (note that this returns only the correct version if the imported modules are already parsed or are not relevant here).

readNewestFlatCurryInt :: String -> IO Prog  Non-deterministic 

Returns the newest FlatCurry interface for a module. The source program is parsed if the interface older than the source, otherwise the FlatCurry interface file is read without parsing (note that this returns only the correct version if the imported modules are already parsed or are not relevant here).

flat2intName :: String -> String  Deterministic 

Translates FlatCurry file name to corresponding FlatCurry interface file name.