
Adrian Neumann wrote:
There was a thread about that:
http://www.haskell.org/pipermail/haskell-cafe/2007-September/ 031402.html
Thanks! I didn't literally mean "elevator pitch" and if I knew that thread existed would have phrased my post differently, because a list of the things that are cool about Haskell will not impress them. What I want and am finding it hard to create are examples where FP shines and, for the same problem, imperative languages look like more work. Many will think of programming solely in terms of developing websites, GUIs, database access, so I will demonstrate how strongly-typed database access can help them. Jim
Am 20.01.2009 um 11:07 schrieb Jim Burton:
Hi, I will be a TA on a comparative PL course and I'm looking for small examples (ammunition) which motivate the use of Haskell and functional programming generally. The course is for 1st year Software Engineers, none of whom are likely to have used a functional language. They will all have experience programming Java and a little C++, with a few of them knowing Python, Ruby, PHP etc etc too.
If anyone has code snippets which are the equivalent of an elevator pitch for FP, I would be very grateful to see them. What I want are some small concrete examples of idioms which are natural and powerful in Haskell but difficult or impossible in, say, Java.
So I can produce examples of some of the things that make FP powerful, elegant, expressive etc: higher order functions, polymorphism, composition (ask them to write (.) in Java :-)), partial application and so on. I will point any interested souls to Hughes' great paper [1]. But I have little time and it might be hard to put across why they would want to do these things in the first place. I was looking for something that speaks directly to the kind of problems they face in languages like Java...
Types are a good example because Java programmers generally already appreciate the help they get from compiler messages etc, so you can sell a more flexible, enhanced form of this. Purity might appeal to anyone who has longed to be able to reason about nastily complex code with a lot of shared state. Laziness, streams? Hard to do in Java (I presume) but also quite hard to sell the need.
The existence of an O'Reilly book will help, especially one that can be sampled online, so I'll point them at RWH for extended concrete examples. They will need to be already sold before they will bother with that though.
Thanks,
Jim
[1] http://www.cs.chalmers.se/~rjmh/Papers/whyfp.html _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Jim Burton