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
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. |
|
Returns the imports (module names) of a given Curry program.
|
Returns the function declarations of a given Curry program.
|
Returns all constructors of given Curry program. |
Returns the type declarations of a given Curry program.
|
Returns the names of all visible functions in given Curry program. |
Returns the names of all visible constructors in given Curry program. |
Returns the names of all visible types in given Curry program. |
Returns the type expression of a qualified type.
|
Returns the class constraints of a qualified type.
|
Returns the name of a given type declaration
|
Returns the visibility of a given type declaration.
|
Returns the constructors of a given type declaration.
|
Returns the name of a given constructor declaration.
|
Returns the visibility of a given constructor declaration.
|
Returns true if the type expression is a base type. |
Returns true if the type expression contains type variables.
|
Returns true if the type expression is a functional type. |
Returns true if the type expression is (IO t) with t/=() and t is not functional |
Return the result type from a (nested) functional type |
Returns all type variables occurring in a type expression.
|
Returns all type constructors used in the given type. |
Returns all modules used in the given type. |
Transforms a type constructor application into a pair of the type constructor and the argument types, if possible. |
Returns the name of a given function declaration.
|
Returns the documentation comment of a given function declaration.
|
Returns the visibility of a given function declaration.
|
Returns the type of a given function declaration.
|
Returns the rules of a given function declaration.
|
Returns the right-hand side of a rules.
|
Returns the local declarations of given rule.
|
Returns list of all variables occurring in a pattern. Each occurrence corresponds to one element, i.e., the list might contain multiple elements. |
Returns list of all variables occurring in an expression. Each occurrence corresponds to one element, i.e., the list might contain multiple elements. |
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. |
Returns list of all variables occurring in a statement. Each occurrence corresponds to one element, i.e., the list might contain multiple elements. |
Returns list of all variables occurring in a local declaration. Each occurrence corresponds to one element, i.e., the list might contain multiple elements. |
Returns list of all variables occurring in a function declaration. Each occurrence corresponds to one element, i.e., the list might contain multiple elements. |
Returns list of all variables occurring in a rule. Each occurrence corresponds to one element, i.e., the list might contain multiple elements. |
|
|
|
Tests whether a module name is the prelude. |