Haskell I/O and XPath
blog.adamretter.org.uk
blog.adamretter.org.uk
Regards implementation, as the type system available in XQuery is much more limited than that of Haskell, I had to choose some mechanism to represent an IO. Actually representing it as a state transforming function that operates on the RealWorld, as was done in the design of the IO Monad for Haskell, seems to work pretty well.
I tried to follow closely and adapt both: 1) Section 7.3 "Monadic I/O" from "A History of Haskell", Hudak, Hughes, Peyton Jones and Wadler 2007 - https://www.microsoft.com/en-us/research/wp-content/uploads/... 2) Section 4 "Implementing monadic I/O" from "Imperative functional programming", Wadler and Peyton Jones 1992 - https://www.microsoft.com/en-us/research/wp-content/uploads/...
Site feedback: That blue bar at the top make it looks like your page hasn't loaded. If I want to see how far I've read, I will just look to the right side at the scrollbar.
As part of a module on XML for my MSc I decided to go maximum overkill, and created in XSLT a simple key-value lookup, a breadth-first node search algorithm, and a simple TAP-based test suite to make sure it all worked properly. Almost looked at seeing how much of the Functional Data Structures book I could cram into XSLT for my dissertation before choosing something a little less ambitious.
good read