Module CPM.Query.Main

A tool to query analysis information about entities (e.g., function, types, type classes) defined in a module of some Curry package.

To use the tool to show information about some function, run

> cpm-query <module name> <function name>

Note that cypm exec is not necessary to invoke the tool since the load path is computed by this tool. For instance, try

> cpm-query Data.List split
> cpm-query System.Process exitWith
> cpm-query System.Directory doesFileExist

Version: January 2025

Summary of exported operations:

:: String  Deterministic 
main :: IO ()  Deterministic 
generateForPackage :: Options -> String -> String -> IO ()  Deterministic 
generateForModule :: Options -> String -> String -> String -> IO ()  Deterministic 
queryModuleEntity :: Options -> String -> String -> IO ()  Deterministic 
queryPackage :: Options -> IO ()  Deterministic 
curryInfoOptions :: Options -> [String]  Deterministic 
curryInfoCmd :: Options -> [String] -> (String,[String])  Deterministic 
callCurryInfo :: Options -> [String] -> IO ()  Deterministic 
askCurryInfoServer :: String -> CurryEntity -> String -> IO (Maybe [((String,String),String)])  Deterministic 
This action starts curry-info in server mode and returns the result of the given request (third argument) for all operations in the module provided as the first argument.
askCurryInfoCmd :: Bool -> String -> CurryEntity -> String -> IO (Maybe [((String,String),String)])  Deterministic 
This action uses the curry-info command to return the result of the given request (third argument) for all entities in the module provided as the first argument.
queryCurryInfo :: Read a => [(String,String)] -> String -> IO a  Deterministic 
Query curry-info with some request where the options are taken from the RC file.
queryCurryInfoWithOptions :: Read a => Options -> [(String,String)] -> String -> IO a  Deterministic 
Query curry-info with some request.
getPackageModules :: Options -> String -> String -> IO [String]  Deterministic 
Get all modules of a package version by curry-info.
getPackageModuleOps :: Options -> String -> String -> IO [(String,Int)]  Deterministic 
Get the number of operations of all modules of a package version.
curryInfoBin :: String  Deterministic 
The binary name of the curry-info tool.
fromQName :: String -> (String,String)  Deterministic 
Transforms a possible qualified name into a pair of a module name (which might be empty) and an unqualified name.
string2urlencoded :: String -> String  Deterministic 
escapeShellString :: String -> String  Deterministic 

Exported operations:

main :: IO ()  Deterministic 

generateForPackage :: Options -> String -> String -> IO ()  Deterministic 

generateForModule :: Options -> String -> String -> String -> IO ()  Deterministic 

queryModuleEntity :: Options -> String -> String -> IO ()  Deterministic 

queryPackage :: Options -> IO ()  Deterministic 

curryInfoOptions :: Options -> [String]  Deterministic 

curryInfoCmd :: Options -> [String] -> (String,[String])  Deterministic 

callCurryInfo :: Options -> [String] -> IO ()  Deterministic 

askCurryInfoServer :: String -> CurryEntity -> String -> IO (Maybe [((String,String),String)])  Deterministic 

This action starts curry-info in server mode and returns the result of the given request (third argument) for all operations in the module provided as the first argument. The requested result is returned in its string representation for each entity in the module. The second argument is the kind of entity to be queried. If it is Unknown, Nothing is returned.

The package and version are determined using the Curry loadpath. If something goes wrong, Nothing is returned.

Further infos:
  • partially defined

askCurryInfoCmd :: Bool -> String -> CurryEntity -> String -> IO (Maybe [((String,String),String)])  Deterministic 

This action uses the curry-info command to return the result of the given request (third argument) for all entities in the module provided as the first argument. The requested result is returned in its string representation for each entity in the module. If the first argument is True, the curry-info server is queried. The third argument is the kind of entity to be queried. If it is Unknown, Nothing is returned.

The package and version are determined using the Curry loadpath. If something goes wrong, Nothing is returned.

Further infos:
  • partially defined

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

Query curry-info with some request where the options are taken from the RC file. The first argument are the curry-info arguments to specify the entity (e.g., package/version/module/option). The second argument is the (single!) request. The result must be readable so that it it is returned as data. In case of a parse error, the program is terminated with an error code.

queryCurryInfoWithOptions :: Read a => Options -> [(String,String)] -> String -> IO a  Deterministic 

Query curry-info with some request. The first argument are the cpm-query options to be used for the query. The second argument are the curry-info arguments to specify the entity (e.g., package/version/module/option). The third argument is the (single!) request. The result must be readable so that it it is returned as data.

getPackageModules :: Options -> String -> String -> IO [String]  Deterministic 

Get all modules of a package version by curry-info. In case of a parse error, the program is terminated with an error state.

getPackageModuleOps :: Options -> String -> String -> IO [(String,Int)]  Deterministic 

Get the number of operations of all modules of a package version. In case of a parse error, the program is terminated with an error state.

curryInfoBin :: String  Deterministic 

The binary name of the curry-info tool.

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

fromQName :: String -> (String,String)  Deterministic 

Transforms a possible qualified name into a pair of a module name (which might be empty) and an unqualified name.

string2urlencoded :: String -> String  Deterministic 

Further infos:
  • partially defined

escapeShellString :: String -> String  Deterministic 

Further infos:
  • partially defined