
On Wed, 23 Jan 2008, Simon Peyton-Jones wrote:
1. Small examples of actual code. The goal here is (a) to convey a visceral idea of what functional programming *is*, rather than just assume the audience knows (they don't), and (b) to convey an idea of why it might be good. One of my favourite examples is quicksort, for reasons explained here: http://haskell.org/haskellwiki/Introduction#What.27s_good_about_functional_p...
But I'm sure that you each have a personal favourite or two. Would you like to send them to me, along with a paragraph or two about why you found it compelling? For this purpose, a dozen lines of code or so is probably a maximum.
With respect to the other thread about exception handling, I can add that C++ programmers strongly disagree on whether exceptions or error return codes are the right way. Also Niklaus Wirth considered exceptions to be the reincarnation of GOTO and thus omitted them in his languages. Maybe the programmers like to hear that Haskell solves the problem the diplomatic way: Function return error codes, but the handling of error codes does not uglify the calling code. Maybe the programmers can recognize the power of the language, if you show them that Haskell does not need additional language support in order to implement classical exception handling. I have extended the article on the Wiki by a short example implementation of exceptions: http://www.haskell.org/haskellwiki/Exception