Module CurryDoc.Read

Some auxiliary operations of CurryDoc to read programs.

Author: Michael Hanus, Jan Tikovsky

Version: November 2017

Summary of exported operations:

readModuleComment :: String -> IO String  Deterministic 
Reads the module comment of a Curry source file.
readComments :: String -> IO (String,[(SourceLine,String)])  Deterministic 
Reads the comments of a source file to be put in the HTML documentation.
readCategory :: [String] -> Category  Deterministic 
Determine the category for a module
showCategory :: Category -> String  Deterministic 
Show a category
getCategoryID :: Category -> String  Deterministic 
ID for a category
classifyLine :: String -> SourceLine  Deterministic 
getFirstId :: String -> String  Deterministic 
isIdChar :: Char -> Bool  Deterministic 
infixIDs :: String  Deterministic 
groupLines :: [SourceLine] -> (String,[(SourceLine,String)])  Deterministic 
groupProgLines :: [SourceLine] -> [(SourceLine,String)]  Deterministic 
groupComment :: String -> [SourceLine] -> [(SourceLine,String)]  Deterministic 
skipFuncDefs :: String -> [SourceLine] -> [(SourceLine,String)]  Deterministic 
skipDataDefs :: String -> [SourceLine] -> [(SourceLine,String)]  Deterministic 
getFuncComment :: String -> [(SourceLine,String)] -> String  Deterministic 
getConsComment :: [String] -> String -> Maybe (String,String)  Deterministic 
getDataComment :: String -> [(SourceLine,String)] -> String  Deterministic 
getCommentType :: Eq a => a -> [(a,b)] -> [b]  Deterministic 
splitComment :: String -> (String,[(String,String)])  Deterministic 
splitCommentMain :: [String] -> (String,[(String,String)])  Deterministic 
splitCommentParams :: String -> String -> [String] -> [(String,String)]  Deterministic 
isFunctionType :: TypeExpr -> Bool  Deterministic 
skipWhiteSpace :: String -> String  Deterministic 
isWhiteSpace :: Char -> Bool  Deterministic 
showId :: String -> String  Deterministic 
brackets :: Bool -> String -> String  Deterministic 
getLastName :: String -> String  Deterministic 

Exported datatypes:


SourceLine

This datatype is used to classify all input lines.

Constructors:

  • Comment :: String -> SourceLine : a comment for CurryDoc
  • FuncDef :: String -> SourceLine : a definition of a function
  • DataDef :: String -> SourceLine : a definition of a datatype
  • ModDef :: SourceLine : a line containing a module definition
  • OtherLine :: SourceLine : a line not relevant for CurryDoc

Category

This datatype is used to categorize Curry libraries

Constructors:

  • General :: Category : a general library
  • Algorithm :: Category : a library which provides data structures and algorithms
  • Database :: Category : a library for database access
  • Web :: Category : a library for web applications
  • Meta :: Category : a library for meta-programming

ModInfo

Type synonym: ModInfo = (Category,String,String)


Exported operations:

readModuleComment :: String -> IO String  Deterministic 

Reads the module comment of a Curry source file.

readComments :: String -> IO (String,[(SourceLine,String)])  Deterministic 

Reads the comments of a source file to be put in the HTML documentation. Returns the module comment and the list of (Func/DataDef,comment) pairs.

readCategory :: [String] -> Category  Deterministic 

Determine the category for a module

showCategory :: Category -> String  Deterministic 

Show a category

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

getCategoryID :: Category -> String  Deterministic 

ID for a category

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

classifyLine :: String -> SourceLine  Deterministic 

getFirstId :: String -> String  Deterministic 

Further infos:
  • partially defined

isIdChar :: Char -> Bool  Deterministic 

infixIDs :: String  Deterministic 

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

groupLines :: [SourceLine] -> (String,[(SourceLine,String)])  Deterministic 

groupProgLines :: [SourceLine] -> [(SourceLine,String)]  Deterministic 

groupComment :: String -> [SourceLine] -> [(SourceLine,String)]  Deterministic 

skipFuncDefs :: String -> [SourceLine] -> [(SourceLine,String)]  Deterministic 

skipDataDefs :: String -> [SourceLine] -> [(SourceLine,String)]  Deterministic 

getFuncComment :: String -> [(SourceLine,String)] -> String  Deterministic 

getConsComment :: [String] -> String -> Maybe (String,String)  Deterministic 

getDataComment :: String -> [(SourceLine,String)] -> String  Deterministic 

getCommentType :: Eq a => a -> [(a,b)] -> [b]  Deterministic 

splitComment :: String -> (String,[(String,String)])  Deterministic 

splitCommentMain :: [String] -> (String,[(String,String)])  Deterministic 

splitCommentParams :: String -> String -> [String] -> [(String,String)]  Deterministic 

isFunctionType :: TypeExpr -> Bool  Deterministic 

skipWhiteSpace :: String -> String  Deterministic 

isWhiteSpace :: Char -> Bool  Deterministic 

showId :: String -> String  Deterministic 

brackets :: Bool -> String -> String  Deterministic 

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

getLastName :: String -> String  Deterministic