Threading State Between Micros

Sometimes a transformation needs access to "state" derived from the processing of textually earlier nodes. When processing a child node, its transformation may depend on the state resulting from processing children to its "left". In this part, I illustrate a technique to achieve such "state-passing", which threads the state through the micros via a monad. The technique is similar to "parameter passing", in that an xml-micro will again return a higher-order function. But the technique differs in that this returned function is invoked via an application of the monad's bind function. The state resulting from application of the function returned by the micro is then passed by bind to the next transformation "computation".

Last modified: Sunday, February 27th, 2005 4:37:51pm
HTML generated using WebIt!.