[xsl] Re: The real harm is in functions with side effects (Was: Re: Using Extension Functions - Its Efficiency)

Subject: [xsl] Re: The real harm is in functions with side effects (Was: Re: Using Extension Functions - Its Efficiency)
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Tue, 20 Jan 2004 20:56:30 +0100
"Kurt Cagle" <kurt@xxxxxxxxxxxxx> wrote in message
> Dmitri,
> I'm somewhat familiar with monads in Haskell; I actually had a chance last
> year to delve into Haskell in preparation for a class that I didn't end up
> taking after all (long story), but the notion of the monads makes a great
> deal of sense. In essence, you are creating an algebra of functional
> compositions to effect type constructors, as I understand the theory.
> This bias of course is not completely unheard of on the imperative side.
> took me a long time to really understand why Kernighan and Ritchie did not
> include i/o as a core functionality of the C language (ditto Pascal) and
> was really only with the fact that K&R understood the implicit problems
> side-effect-oriented languages but didn't yet have a foundation upon which
> to formalize that relationship (as C preceded Haskell by several years, if
> memory serves).
> Perhaps the question that should be raised at this stage is whether in
> there is a way to introduce monadic characteristics into XSLT2 at this
> date. I'm currenly working on a publishing system that is HEAVILY XSLT2
> based, and struggling to keep my programmers on the straight and narrow
> side-effect oriented language. Could you point me to the direction of your
> monographs on monads in XSLT2? I remember skimming it once, but I was
> down in SVG code at the time and hadn't really taken the time to
> it.

Hi Kurt,

I am really sorry I was very busy the last two days, so now is the first
moment I can address your post in the xsl-list -- and it needs serious

Please, find attached (off-list) the zip archive containing all necessary

Unfortunately, there's no documentation. The templates generally follow the
functions in Simon Payton-Jones "Tackling the awkward squad: monadic
input/output, concurrency, exceptions, and foreign-language calls in
Haskell," which can be found at:


To get a feeling what this package can do it is best to run the testDo.xsl
transformation against any xml source document (ignored).

I have implemented the "do notation" and the examples show how it
works -- sequence of arithmetic calculations with or without brackets, using
repeatedly multiple variables, which can be updated, I/O (reading text with
even exceptions.

Ideally I will try to find some time to write an article, especially if I
receive some positive feedback.

Please, feel free to ask any questions.


Dimitre Novatchev.
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread