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

Exported operations:

lowerFirst :: String -> String   

lower the first character in a string

tupleName :: Int -> (String,String)   

Construct the name of an n-ary tuple.

ctvar :: String -> TypeExpr   

A type variable.

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

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

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   

A base type (type constructor without arguments).

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

listType :: TypeExpr -> TypeExpr   

Constructs a list type from element type.

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

tupleType :: [TypeExpr] -> TypeExpr   

Constructs a tuple type from list of component types.

ioType :: TypeExpr -> TypeExpr   

Constructs an IO type from a type.

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

maybeType :: TypeExpr -> TypeExpr   

Constructs a Maybe type from element type.

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

stringType :: TypeExpr   

The String type.

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

intType :: TypeExpr   

The Int type.

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

boolType :: TypeExpr   

The Bool type.

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

dateType :: TypeExpr   

The Date type.

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

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

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

A typed function declaration.

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

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

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   

A typed function declaration with a documentation comment.

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

funcDecls :: Prog -> [FuncDecl]   

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

funcName :: FuncDecl -> (String,String)   

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

typeOf :: FuncDecl -> TypeSig   

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

commentOf :: FuncDecl -> String   

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

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

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

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

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

constF :: (String,String) -> Expr   

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

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

An application of a variable to a list of arguments.

tuplePat :: [Pattern] -> Pattern   

Constructs a tuple pattern from list of component patterns.

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

tupleExpr :: [Expr] -> Expr   

Constructs a tuple expression from list of component expressions.

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

string2ac :: String -> Expr   

transform a string constant into AbstractHaskell term

pre :: String -> (String,String)   

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

cvar :: String -> Expr   

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

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

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

list2ac :: [Expr] -> Expr   

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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