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

Exported operations:

progName :: CurryProg -> String  Deterministic 

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

imports :: CurryProg -> [String]  Deterministic 

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

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

functions :: CurryProg -> [CFuncDecl]  Deterministic 

Returns the function declarations of a given Curry program.

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

constructors :: CurryProg -> [CConsDecl]  Deterministic 

Returns all constructors of given Curry program.

types :: CurryProg -> [CTypeDecl]  Deterministic 

Returns the type declarations of a given Curry program.

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

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

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

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

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

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

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

typeOfQualType :: CQualTypeExpr -> CTypeExpr  Deterministic 

Returns the type expression of a qualified type.

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

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

Returns the class constraints of a qualified type.

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

typeName :: CTypeDecl -> (String,String)  Deterministic 

Returns the name of a given type declaration

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

typeVis :: CTypeDecl -> CVisibility  Deterministic 

Returns the visibility of a given type declaration.

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

typeCons :: CTypeDecl -> [CConsDecl]  Deterministic 

Returns the constructors of a given type declaration.

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

consName :: CConsDecl -> (String,String)  Deterministic 

Returns the name of a given constructor declaration.

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

consVis :: CConsDecl -> CVisibility  Deterministic 

Returns the visibility of a given constructor declaration.

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

isBaseType :: CTypeExpr -> Bool  Deterministic 

Returns true if the type expression is a base type.

isPolyType :: CTypeExpr -> Bool  Deterministic 

Returns true if the type expression contains type variables.

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

isFunctionalType :: CTypeExpr -> Bool  Deterministic 

Returns true if the type expression is a functional type.

isIOType :: CTypeExpr -> Bool  Deterministic 

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

isIOReturnType :: CTypeExpr -> Bool  Deterministic 

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

argTypes :: CTypeExpr -> [CTypeExpr]  Deterministic 

Returns all argument types from a functional type

resultType :: CTypeExpr -> CTypeExpr  Deterministic 

Return the result type from a (nested) functional type

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

Returns all type variables occurring in a type expression.

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

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

Returns all type constructors used in the given type.

modsOfType :: CTypeExpr -> [String]  Deterministic 

Returns all modules used in the given type.

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

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

funcName :: CFuncDecl -> (String,String)  Deterministic 

Returns the name of a given function declaration.

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

funcArity :: CFuncDecl -> Int  Deterministic 

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

funcComment :: CFuncDecl -> String  Deterministic 

Returns the documentation comment of a given function declaration.

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

funcVis :: CFuncDecl -> CVisibility  Deterministic 

Returns the visibility of a given function declaration.

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

funcType :: CFuncDecl -> CQualTypeExpr  Deterministic 

Returns the type of a given function declaration.

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

funcRules :: CFuncDecl -> [CRule]  Deterministic 

Returns the rules of a given function declaration.

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

ruleRHS :: CRule -> CRhs  Deterministic 

Returns the right-hand side of a rules.

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

ldeclsOfRule :: CRule -> [CLocalDecl]  Deterministic 

Returns the local declarations of given rule.

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

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

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)]  Deterministic 

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)]  Deterministic 

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)]  Deterministic 

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)]  Deterministic 

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)]  Deterministic 

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)]  Deterministic 

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)]  Deterministic 

Returns:
The list of declared function names of the given local declaration.

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

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)]  Deterministic 

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

isPrelude :: String -> Bool  Deterministic 

Tests whether a module name is the prelude.