Module CurryDoc.Main

Implementation of CurryDoc, a utility for the automatic generation of HTML documentation from Curry programs.

Author: Michael Hanus, Jan Tikovsky

Version: December 2020

Summary of exported operations:

:: String  Deterministic 
includeDir :: String  Deterministic 
main :: IO ()  Non-deterministic 
processArgs :: DocOptions -> [String] -> IO ()  Non-deterministic 
processOpts :: DocOptions -> IO DocOptions  Deterministic 
printUsageMessage :: IO ()  Deterministic 
createDir :: String -> IO ()  Deterministic 
copyDirectory :: String -> String -> IO ()  Deterministic 
Recursively copies a directory structure.
makeCompleteDoc :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 
The main function of the CurryDoc utility.
makeAbsolute :: String -> IO String  Deterministic 
Transform a file path into an absolute file path:
makeIndexPages :: DocOptions -> String -> [String] -> IO ()  Non-deterministic 
Generate only the index pages for a list of (already compiled!) modules:
makeSystemLibsIndex :: DocOptions -> String -> [String] -> IO ()  Non-deterministic 
Generate a system library index page categorizing the given (already compiled!) modules
getModInfo :: String -> IO (Category,String,String)  Deterministic 
prepareDocDir :: DocType -> String -> IO ()  Deterministic 
copyIncludeIfPresent :: String -> String -> IO ()  Deterministic 
readAnaInfo :: String -> IO AnaInfo  Non-deterministic 
makeDoc :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 
makeDocWithComments :: DocType -> DocOptions -> Bool -> String -> AnaInfo -> String -> String -> [(SourceLine,String)] -> IO ()  Non-deterministic 
makeDocIfNecessary :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 
Generates the documentation for a module if it is necessary.
getImports :: String -> IO [String]  Non-deterministic 
copyOrMakeDoc :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 
copyDocIfPossible :: DocOptions -> String -> String -> IO Bool  Deterministic 
Copy the documentation file from standard documentation directoy "CDOC" (used for documentation of system libraries) if possible.
readTypesFuncsWithImports :: String -> IO ([TypeDecl],[FuncDecl])  Non-deterministic 
fileExtension :: DocType -> String  Deterministic 
writeOutfile :: DocOptions -> Bool -> String -> String -> IO String -> IO ()  Non-deterministic 

Exported operations:

includeDir :: String  Deterministic 

main :: IO ()  Non-deterministic 

processArgs :: DocOptions -> [String] -> IO ()  Non-deterministic 

printUsageMessage :: IO ()  Deterministic 

createDir :: String -> IO ()  Deterministic 

copyDirectory :: String -> String -> IO ()  Deterministic 

Recursively copies a directory structure.

makeCompleteDoc :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 

The main function of the CurryDoc utility.

Example call:
(makeCompleteDoc docopts recursive docdir modname)
Parameters:
  • docopts : the options for CurryDoc
  • recursive : True if the documentation for the imported modules should be also generated (if necessary)
  • docdir : the directory name containing all documentation files
  • modname : the name of the main module to be documented

makeAbsolute :: String -> IO String  Deterministic 

Transform a file path into an absolute file path:

makeIndexPages :: DocOptions -> String -> [String] -> IO ()  Non-deterministic 

Generate only the index pages for a list of (already compiled!) modules:

makeSystemLibsIndex :: DocOptions -> String -> [String] -> IO ()  Non-deterministic 

Generate a system library index page categorizing the given (already compiled!) modules

getModInfo :: String -> IO (Category,String,String)  Deterministic 

prepareDocDir :: DocType -> String -> IO ()  Deterministic 

copyIncludeIfPresent :: String -> String -> IO ()  Deterministic 

readAnaInfo :: String -> IO AnaInfo  Non-deterministic 

makeDoc :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 

makeDocWithComments :: DocType -> DocOptions -> Bool -> String -> AnaInfo -> String -> String -> [(SourceLine,String)] -> IO ()  Non-deterministic 

makeDocIfNecessary :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 

Generates the documentation for a module if it is necessary. I.e., the documentation is generated if no previous documentation file exists or if the existing documentation file is older than the FlatCurry file.

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

copyOrMakeDoc :: DocOptions -> Bool -> String -> String -> IO ()  Non-deterministic 

copyDocIfPossible :: DocOptions -> String -> String -> IO Bool  Deterministic 

Copy the documentation file from standard documentation directoy "CDOC" (used for documentation of system libraries) if possible. Returns true if the copy was possible.

readTypesFuncsWithImports :: String -> IO ([TypeDecl],[FuncDecl])  Non-deterministic 

fileExtension :: DocType -> String  Deterministic 

Further infos:
  • solution complete, i.e., able to compute all solutions

writeOutfile :: DocOptions -> Bool -> String -> String -> IO String -> IO ()  Non-deterministic