evan_tech

Previous Entry Share Next Entry
I was googling for an image visually representing what "fold" does (the current homework in my programming languages class involves implementing a fold-like function and the students are hardly comfortable with induction/recursion, let alone functions as parameters, polymorphism, etc.) and I came across this page.

They define a numerical integration function, first in Haskell and then in XSLT. The Haskell is five lines near the beginning. To see the XSLT, scroll down a few pages: it's on a colored background so you won't miss it.