This module provides some useful functions to write the code generating AbstractHaskell programs more compact and readable.
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
|
lower the first character in a string |
Construct the name of an n-ary tuple. |
A type variable.
|
A function type.
|
A base type (type constructor without arguments).
|
Constructs a list type from element type.
|
Constructs an IO type from a type.
|
Constructs a Maybe type from element type.
|
The
|
The
|
The
|
The
|
A typed function declaration.
|
A typed function declaration with a type context.
|
A typed function declaration with a documentation comment.
|
|
|
|
|
An application of a qualified function name to a list of arguments. |
Constructs a tuple pattern from list of component patterns.
|
Constructs a tuple expression from list of component expressions.
|
|
Build a let declaration (with a possibly empty list of local declarations) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|