Hets - the Heterogeneous Tool Set

Copyright (c) Ewaryst.Schulz DFKI 2010 GPLv2 or higher, see LICENSE.txt Ewaryst.Schulz@dfki.de provisional portable Safe

CSL.Fold

Description

folding functions for CSL terms and commands

Synopsis

# Documentation

data Record a b Source #

Constructors

 Record FieldsfoldAss :: 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 Source #

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

The identity transformation

Passes the transformation through the CMD part and is the identity on the EXPRESSION part

Passes the transformation through both, the CMD and the EXPRESSION part

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 Source #

Returns the first constant on the CMD part and the second on the EXPRESSION part

foldCMD :: Record a b -> CMD -> a Source #