This library provides some useful operations to select components in AbstractCurry programs, i.e., it provides a collection of selector functions for AbstractCurry.
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.
isMultiParamTypeClass
:: CClassDecl -> Bool
Returns true if the given type class declaration has more than one type variable.
hasFunDeps
:: CClassDecl -> Bool
Returns true if the given type class declaration has functional dependencies.
typeClasses
:: CurryProg -> [CClassDecl]
Returns the type class declarations of a given Curry program.
instances
:: CurryProg -> [CInstanceDecl]
Returns the instance declarations of a 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.
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.
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.
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. 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)]
:: CLocalDecl
|
|
-> [QName]
|
The list of declared function names of the given local declaration. |
funcNamesOfFDecl
:: CFuncDecl -> [(String, String)]
:: CFuncDecl
|
|
-> [QName]
|
The declared function name of given function declaration in a list. |
funcNamesOfStat
:: CStatement -> [(String, String)]
:: CStatement
|
|
-> [QName]
|
The declared function names of given statement in a list. |
Tests whether a module name is the prelude.