Copyright | (c) Ewaryst.Schulz, DFKI 2010 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Ewaryst.Schulz@dfki.de |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
folding functions for CSL terms and commands
- data Record a b = Record {
- foldAss :: CMD -> OpDecl -> b -> a
- foldCmd :: CMD -> String -> [b] -> a
- foldSequence :: CMD -> [a] -> a
- foldCond :: CMD -> [(b, [a])] -> a
- foldRepeat :: CMD -> b -> [a] -> a
- foldVar :: EXPRESSION -> Token -> b
- foldOp :: EXPRESSION -> OPID -> [EXTPARAM] -> [b] -> Range -> b
- foldList :: EXPRESSION -> [b] -> Range -> b
- foldInterval :: EXPRESSION -> Double -> Double -> Range -> b
- foldInt :: EXPRESSION -> APInt -> Range -> b
- foldRat :: EXPRESSION -> APFloat -> Range -> b
- emptyRecord :: String -> Record a b
- idRecord :: Record CMD EXPRESSION
- passRecord :: Record CMD EXPRESSION
- passAllRecord :: Record CMD EXPRESSION
- listCMDRecord :: Record [a] EXPRESSION
- constRecord :: a -> b -> Record a b
- foldCMD :: Record a b -> CMD -> a
- foldTerm :: Record a b -> EXPRESSION -> b
Documentation
data Record a b
Record | |
|
emptyRecord :: String -> Record a b
Produces an error with given message on all entries. Use this if you overwrite only the EXPRESSION part and you do not use the CMD part anyway , e.g., if you use the record in foldTerm
idRecord :: Record CMD EXPRESSION
The identity transformation
passRecord :: Record CMD EXPRESSION
Passes the transformation through the CMD part and is the identity on the EXPRESSION part
passAllRecord :: Record CMD EXPRESSION
Passes the transformation through both, the CMD and the EXPRESSION part
listCMDRecord :: Record [a] EXPRESSION
Passes the transformation through the CMD
part by concatenating the
processed list from left to right and identity on expression part
constRecord :: a -> b -> Record a b
Returns the first constant on the CMD part and the second on the EXPRESSION part
foldTerm :: Record a b -> EXPRESSION -> b