Module AbstractCurry.Select

This library provides some useful operations to select components in AbstractCurry programs, i.e., it provides a collection of selector functions for AbstractCurry.

Version: October 2016

Summary of exported operations:

progName :: CurryProg -> String   
imports :: CurryProg -> [String]   
Returns the imports (module names) of a given Curry program.
functions :: CurryProg -> [CFuncDecl]   
Returns the function declarations of a given Curry program.
constructors :: CurryProg -> [CConsDecl]   
Returns all constructors of given Curry program.
types :: CurryProg -> [CTypeDecl]   
Returns the type declarations of a given Curry program.
publicFuncNames :: CurryProg -> [(String,String)]   
Returns the names of all visible functions in given Curry program.
publicConsNames :: CurryProg -> [(String,String)]   
Returns the names of all visible constructors in given Curry program.
publicTypeNames :: CurryProg -> [(String,String)]   
Returns the names of all visible types in given Curry program.
typeOfQualType :: CQualTypeExpr -> CTypeExpr   
Returns the type expression of a qualified type.
classConstraintsOfQualType :: CQualTypeExpr -> [((String,String),CTypeExpr)]   
Returns the class constraints of a qualified type.
typeName :: CTypeDecl -> (String,String)   
Returns the name of a given type declaration
typeVis :: CTypeDecl -> CVisibility   
Returns the visibility of a given type declaration.
typeCons :: CTypeDecl -> [CConsDecl]   
Returns the constructors of a given type declaration.
consName :: CConsDecl -> (String,String)   
Returns the name of a given constructor declaration.
consVis :: CConsDecl -> CVisibility   
Returns the visibility of a given constructor declaration.
isBaseType :: CTypeExpr -> Bool   
Returns true if the type expression is a base type.
isPolyType :: CTypeExpr -> Bool   
Returns true if the type expression contains type variables.
isFunctionalType :: CTypeExpr -> Bool   
Returns true if the type expression is a functional type.
isIOType :: CTypeExpr -> Bool   
Returns true if the type expression is (IO t).
isIOReturnType :: CTypeExpr -> Bool   
Returns true if the type expression is (IO t) with t/=() and t is not functional
argTypes :: CTypeExpr -> [CTypeExpr]   
Returns all argument types from a functional type
resultType :: CTypeExpr -> CTypeExpr   
Return the result type from a (nested) functional type
tvarsOfType :: CTypeExpr -> [(Int,String)]   
Returns all type variables occurring in a type expression.
tconsOfType :: CTypeExpr -> [(String,String)]   
Returns all type constructors used in the given type.
modsOfType :: CTypeExpr -> [String]   
Returns all modules used in the given type.
tconsArgsOfType :: CTypeExpr -> Maybe ((String,String),[CTypeExpr])   
Transforms a type constructor application into a pair of the type constructor and the argument types, if possible.
funcName :: CFuncDecl -> (String,String)   
Returns the name of a given function declaration.
funcArity :: CFuncDecl -> Int   
funcComment :: CFuncDecl -> String   
Returns the documentation comment of a given function declaration.
funcVis :: CFuncDecl -> CVisibility   
Returns the visibility of a given function declaration.
funcType :: CFuncDecl -> CQualTypeExpr   
Returns the type of a given function declaration.
funcRules :: CFuncDecl -> [CRule]   
Returns the rules of a given function declaration.
ruleRHS :: CRule -> CRhs   
Returns the right-hand side of a rules.
ldeclsOfRule :: CRule -> [CLocalDecl]   
Returns the local declarations of given rule.
varsOfPat :: CPattern -> [(Int,String)]   
Returns list of all variables occurring in a pattern.
varsOfExp :: CExpr -> [(Int,String)]   
Returns list of all variables occurring in an expression.
varsOfRhs :: CRhs -> [(Int,String)]   
Returns list of all variables occurring in a right-hand side.
varsOfStat :: CStatement -> [(Int,String)]   
Returns list of all variables occurring in a statement.
varsOfLDecl :: CLocalDecl -> [(Int,String)]   
Returns list of all variables occurring in a local declaration.
varsOfFDecl :: CFuncDecl -> [(Int,String)]   
Returns list of all variables occurring in a function declaration.
varsOfRule :: CRule -> [(Int,String)]   
Returns list of all variables occurring in a rule.
funcNamesOfLDecl :: CLocalDecl -> [(String,String)]   
funcNamesOfFDecl :: CFuncDecl -> [(String,String)]   
funcNamesOfStat :: CStatement -> [(String,String)]   
isPrelude :: String -> Bool   
Tests whether a module name is the prelude.

Exported operations:

progName :: CurryProg -> String   

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

imports :: CurryProg -> [String]   

Returns the imports (module names) of a given Curry program.

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

functions :: CurryProg -> [CFuncDecl]   

Returns the function declarations of a given Curry program.

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

constructors :: CurryProg -> [CConsDecl]   

Returns all constructors of given Curry program.

types :: CurryProg -> [CTypeDecl]   

Returns the type declarations of a given Curry program.

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

publicFuncNames :: CurryProg -> [(String,String)]   

Returns the names of all visible functions in given Curry program.

publicConsNames :: CurryProg -> [(String,String)]   

Returns the names of all visible constructors in given Curry program.

publicTypeNames :: CurryProg -> [(String,String)]   

Returns the names of all visible types in given Curry program.

typeOfQualType :: CQualTypeExpr -> CTypeExpr   

Returns the type expression of a qualified type.

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

classConstraintsOfQualType :: CQualTypeExpr -> [((String,String),CTypeExpr)]   

Returns the class constraints of a qualified type.

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

typeName :: CTypeDecl -> (String,String)   

Returns the name of a given type declaration

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

typeVis :: CTypeDecl -> CVisibility   

Returns the visibility of a given type declaration.

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

typeCons :: CTypeDecl -> [CConsDecl]   

Returns the constructors of a given type declaration.

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

consName :: CConsDecl -> (String,String)   

Returns the name of a given constructor declaration.

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

consVis :: CConsDecl -> CVisibility   

Returns the visibility of a given constructor declaration.

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

isBaseType :: CTypeExpr -> Bool   

Returns true if the type expression is a base type.

isPolyType :: CTypeExpr -> Bool   

Returns true if the type expression contains type variables.

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

isFunctionalType :: CTypeExpr -> Bool   

Returns true if the type expression is a functional type.

isIOType :: CTypeExpr -> Bool   

Returns true if the type expression is (IO t).

isIOReturnType :: CTypeExpr -> Bool   

Returns true if the type expression is (IO t) with t/=() and t is not functional

argTypes :: CTypeExpr -> [CTypeExpr]   

Returns all argument types from a functional type

resultType :: CTypeExpr -> CTypeExpr   

Return the result type from a (nested) functional type

tvarsOfType :: CTypeExpr -> [(Int,String)]   

Returns all type variables occurring in a type expression.

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

tconsOfType :: CTypeExpr -> [(String,String)]   

Returns all type constructors used in the given type.

modsOfType :: CTypeExpr -> [String]   

Returns all modules used in the given type.

tconsArgsOfType :: CTypeExpr -> Maybe ((String,String),[CTypeExpr])   

Transforms a type constructor application into a pair of the type constructor and the argument types, if possible.

funcName :: CFuncDecl -> (String,String)   

Returns the name of a given function declaration.

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

funcArity :: CFuncDecl -> Int   

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

funcComment :: CFuncDecl -> String   

Returns the documentation comment of a given function declaration.

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

funcVis :: CFuncDecl -> CVisibility   

Returns the visibility of a given function declaration.

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

funcType :: CFuncDecl -> CQualTypeExpr   

Returns the type of a given function declaration.

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

funcRules :: CFuncDecl -> [CRule]   

Returns the rules of a given function declaration.

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

ruleRHS :: CRule -> CRhs   

Returns the right-hand side of a rules.

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

ldeclsOfRule :: CRule -> [CLocalDecl]   

Returns the local declarations of given rule.

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

varsOfPat :: CPattern -> [(Int,String)]   

Returns list of all variables occurring in a pattern. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

varsOfExp :: CExpr -> [(Int,String)]   

Returns list of all variables occurring in an expression. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

varsOfRhs :: CRhs -> [(Int,String)]   

Returns list of all variables occurring in a right-hand side. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

varsOfStat :: CStatement -> [(Int,String)]   

Returns list of all variables occurring in a statement. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

varsOfLDecl :: CLocalDecl -> [(Int,String)]   

Returns list of all variables occurring in a local declaration. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

varsOfFDecl :: CFuncDecl -> [(Int,String)]   

Returns list of all variables occurring in a function declaration. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

varsOfRule :: CRule -> [(Int,String)]   

Returns list of all variables occurring in a rule. Each occurrence corresponds to one element, i.e., the list might contain multiple elements.

funcNamesOfLDecl :: CLocalDecl -> [(String,String)]   

Returns:
The declared function name of given local declaration in a list.

funcNamesOfFDecl :: CFuncDecl -> [(String,String)]   

Returns:
The declared function name of given function declaration in a list.
Further infos:
  • solution complete, i.e., able to compute all solutions

funcNamesOfStat :: CStatement -> [(String,String)]   

Returns:
The declared function names of given statement in a list.

isPrelude :: String -> Bool   

Tests whether a module name is the prelude.