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: May 2025

Summary of exported operations:

main :: 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 -> Int -> String -> CurryEntity -> String -> String -> IO (Maybe String)  Deterministic 
This action uses the curry-info command to return the result of the given request (fifth argument) for all entities in the module provided as the third argument.
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.

Exported operations:

main :: 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.

Example: get the demanded arguments of all operation in module Data.List:

> askCurryInfoServer "Data.List" Operation "demand"
Further infos:
  • partially defined

askCurryInfoCmd :: Bool -> Int -> String -> CurryEntity -> String -> String -> IO (Maybe String)  Deterministic 

This action uses the curry-info command to return the result of the given request (fifth argument) for all entities in the module provided as the third argument. The requested result is returned in its string representation. If the first argument is True, the curry-info web service is queried. The second is the verbosity (where 0 means quiet). The third argument is the kind of entity to be queried. If it is Unknown, Nothing is returned. The sixth argument specifies the output format, e.g., "Text", "JSON", "CurryTerm", or "CurryMap".

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

Example: get the demanded arguments of all operations in module Data.List:

> askCurryInfoCmd True 1 "Data.Maybe" Operation "demand" "JSON"

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.