Module AbstractHaskell.Goodies

This module provides some useful functions to write the code generating AbstractHaskell programs more compact and readable.

Summary of exported operations:

lowerFirst :: String -> String  Deterministic 
lower the first character in a string
tupleName :: Int -> (String,String)  Deterministic 
Construct the name of an n-ary tuple.
ctvar :: String -> TypeExpr  Deterministic 
A type variable.
(~>) :: TypeExpr -> TypeExpr -> TypeExpr  Deterministic 
A function type.
baseType :: (String,String) -> TypeExpr  Deterministic 
A base type (type constructor without arguments).
listType :: TypeExpr -> TypeExpr  Deterministic 
Constructs a list type from element type.
tupleType :: [TypeExpr] -> TypeExpr  Deterministic 
Constructs a tuple type from list of component types.
ioType :: TypeExpr -> TypeExpr  Deterministic 
Constructs an IO type from a type.
maybeType :: TypeExpr -> TypeExpr  Deterministic 
Constructs a Maybe type from element type.
stringType :: TypeExpr  Deterministic 
The String type.
intType :: TypeExpr  Deterministic 
The Int type.
boolType :: TypeExpr  Deterministic 
The Bool type.
dateType :: TypeExpr  Deterministic 
The Date type.
tyVarsOf :: TypeExpr -> [(Int,String)]  Deterministic 
tfunc :: (String,String) -> Int -> Visibility -> TypeExpr -> [Rule] -> FuncDecl  Deterministic 
A typed function declaration.
ctfunc :: (String,String) -> Int -> Visibility -> [Context] -> TypeExpr -> [Rule] -> FuncDecl  Deterministic 
A typed function declaration with a type context.
cmtfunc :: String -> (String,String) -> Int -> Visibility -> [Context] -> TypeExpr -> [Rule] -> FuncDecl  Deterministic 
A typed function declaration with a documentation comment.
funcDecls :: Prog -> [FuncDecl]  Deterministic 
funcName :: FuncDecl -> (String,String)  Deterministic 
typeOf :: FuncDecl -> TypeSig  Deterministic 
commentOf :: FuncDecl -> String  Deterministic 
simpleRule :: [Pattern] -> Expr -> Rules  Deterministic 
applyF :: (String,String) -> [Expr] -> Expr  Deterministic 
An application of a qualified function name to a list of arguments.
constF :: (String,String) -> Expr  Deterministic 
A constant, i.e., an application without arguments.
applyV :: (Int,String) -> [Expr] -> Expr  Deterministic 
An application of a variable to a list of arguments.
tuplePat :: [Pattern] -> Pattern  Deterministic 
Constructs a tuple pattern from list of component patterns.
tupleExpr :: [Expr] -> Expr  Deterministic 
Constructs a tuple expression from list of component expressions.
string2ac :: String -> Expr  Deterministic 
transform a string constant into AbstractHaskell term
pre :: String -> (String,String)  Deterministic 
cvar :: String -> Expr  Deterministic 
clet :: [LocalDecl] -> Expr -> Expr  Deterministic 
Build a let declaration (with a possibly empty list of local declarations)
list2ac :: [Expr] -> Expr  Deterministic 
declVar :: (Int,String) -> Expr -> LocalDecl  Deterministic 
renameSymbolInProg :: ((String,String) -> (String,String)) -> Prog -> Prog  Deterministic 
renameSymbolInTypeDecl :: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl  Deterministic 
renameSymbolInConsDecl :: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl  Deterministic 
renameSymbolInNewConsDecl :: ((String,String) -> (String,String)) -> NewConsDecl -> NewConsDecl  Deterministic 
renameSymbolInTypeExpr :: ((String,String) -> (String,String)) -> TypeExpr -> TypeExpr  Deterministic 
renameSymbolInExpr :: ((String,String) -> (String,String)) -> Expr -> Expr  Deterministic 
renameSymbolInPat :: ((String,String) -> (String,String)) -> Pattern -> Pattern  Deterministic 
renameSymbolInBranch :: ((String,String) -> (String,String)) -> BranchExpr -> BranchExpr  Deterministic 
renameSymbolInStat :: ((String,String) -> (String,String)) -> Statement -> Statement  Deterministic 
renameSymbolInLocal :: ((String,String) -> (String,String)) -> LocalDecl -> LocalDecl  Deterministic 
renameSymbolInTypeSig :: ((String,String) -> (String,String)) -> TypeSig -> TypeSig  Deterministic 
renameSymbolInContext :: ((String,String) -> (String,String)) -> Context -> Context  Deterministic 
renameSymbolInFunc :: ((String,String) -> (String,String)) -> FuncDecl -> FuncDecl  Deterministic 
renameSymbolInRules :: ((String,String) -> (String,String)) -> Rules -> Rules  Deterministic 
renameSymbolInRule :: ((String,String) -> (String,String)) -> Rule -> Rule  Deterministic 
renameSymbolInRhs :: ((String,String) -> (String,String)) -> Rhs -> Rhs  Deterministic 
renameOpDecl :: ((String,String) -> (String,String)) -> OpDecl -> OpDecl  Deterministic 

Exported operations:

lowerFirst :: String -> String  Deterministic 

lower the first character in a string

tupleName :: Int -> (String,String)  Deterministic 

Construct the name of an n-ary tuple.

ctvar :: String -> TypeExpr  Deterministic 

A type variable.

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

(~>) :: TypeExpr -> TypeExpr -> TypeExpr  Deterministic 

A function type.

Further infos:
  • defined as right-associative infix operator with precedence 9
  • solution complete, i.e., able to compute all solutions

baseType :: (String,String) -> TypeExpr  Deterministic 

A base type (type constructor without arguments).

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

listType :: TypeExpr -> TypeExpr  Deterministic 

Constructs a list type from element type.

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

tupleType :: [TypeExpr] -> TypeExpr  Deterministic 

Constructs a tuple type from list of component types.

ioType :: TypeExpr -> TypeExpr  Deterministic 

Constructs an IO type from a type.

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

maybeType :: TypeExpr -> TypeExpr  Deterministic 

Constructs a Maybe type from element type.

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

stringType :: TypeExpr  Deterministic 

The String type.

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

intType :: TypeExpr  Deterministic 

The Int type.

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

boolType :: TypeExpr  Deterministic 

The Bool type.

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

dateType :: TypeExpr  Deterministic 

The Date type.

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

tyVarsOf :: TypeExpr -> [(Int,String)]  Deterministic 

tfunc :: (String,String) -> Int -> Visibility -> TypeExpr -> [Rule] -> FuncDecl  Deterministic 

A typed function declaration.

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

ctfunc :: (String,String) -> Int -> Visibility -> [Context] -> TypeExpr -> [Rule] -> FuncDecl  Deterministic 

A typed function declaration with a type context.

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

cmtfunc :: String -> (String,String) -> Int -> Visibility -> [Context] -> TypeExpr -> [Rule] -> FuncDecl  Deterministic 

A typed function declaration with a documentation comment.

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

funcDecls :: Prog -> [FuncDecl]  Deterministic 

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

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

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

typeOf :: FuncDecl -> TypeSig  Deterministic 

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

commentOf :: FuncDecl -> String  Deterministic 

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

simpleRule :: [Pattern] -> Expr -> Rules  Deterministic 

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

applyF :: (String,String) -> [Expr] -> Expr  Deterministic 

An application of a qualified function name to a list of arguments.

constF :: (String,String) -> Expr  Deterministic 

A constant, i.e., an application without arguments.

applyV :: (Int,String) -> [Expr] -> Expr  Deterministic 

An application of a variable to a list of arguments.

tuplePat :: [Pattern] -> Pattern  Deterministic 

Constructs a tuple pattern from list of component patterns.

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

tupleExpr :: [Expr] -> Expr  Deterministic 

Constructs a tuple expression from list of component expressions.

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

string2ac :: String -> Expr  Deterministic 

transform a string constant into AbstractHaskell term

pre :: String -> (String,String)  Deterministic 

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

cvar :: String -> Expr  Deterministic 

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

clet :: [LocalDecl] -> Expr -> Expr  Deterministic 

Build a let declaration (with a possibly empty list of local declarations)

list2ac :: [Expr] -> Expr  Deterministic 

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

declVar :: (Int,String) -> Expr -> LocalDecl  Deterministic 

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

renameSymbolInProg :: ((String,String) -> (String,String)) -> Prog -> Prog  Deterministic 

renameSymbolInTypeDecl :: ((String,String) -> (String,String)) -> TypeDecl -> TypeDecl  Deterministic 

renameSymbolInConsDecl :: ((String,String) -> (String,String)) -> ConsDecl -> ConsDecl  Deterministic 

renameSymbolInNewConsDecl :: ((String,String) -> (String,String)) -> NewConsDecl -> NewConsDecl  Deterministic 

renameSymbolInTypeExpr :: ((String,String) -> (String,String)) -> TypeExpr -> TypeExpr  Deterministic 

renameSymbolInExpr :: ((String,String) -> (String,String)) -> Expr -> Expr  Deterministic 

renameSymbolInPat :: ((String,String) -> (String,String)) -> Pattern -> Pattern  Deterministic 

renameSymbolInBranch :: ((String,String) -> (String,String)) -> BranchExpr -> BranchExpr  Deterministic 

renameSymbolInStat :: ((String,String) -> (String,String)) -> Statement -> Statement  Deterministic 

renameSymbolInLocal :: ((String,String) -> (String,String)) -> LocalDecl -> LocalDecl  Deterministic 

renameSymbolInTypeSig :: ((String,String) -> (String,String)) -> TypeSig -> TypeSig  Deterministic 

renameSymbolInContext :: ((String,String) -> (String,String)) -> Context -> Context  Deterministic 

renameSymbolInFunc :: ((String,String) -> (String,String)) -> FuncDecl -> FuncDecl  Deterministic 

renameSymbolInRules :: ((String,String) -> (String,String)) -> Rules -> Rules  Deterministic 

renameSymbolInRule :: ((String,String) -> (String,String)) -> Rule -> Rule  Deterministic 

renameSymbolInRhs :: ((String,String) -> (String,String)) -> Rhs -> Rhs  Deterministic 

renameOpDecl :: ((String,String) -> (String,String)) -> OpDecl -> OpDecl  Deterministic