Haskell vs. Java Smackdown


Defmacro.org has a small example of Haskell's expressive power and the same code written in Java. Both take five lines of code to "[go] through a parse tree of Haskell source code, locates every reference to an identifier that ends with 'Widget', puts it on a list, and removes duplicates so every identifier is represented in the list only once." Impressive. I believe that Haskell code is a bit more general and defmacro.org argues that it's more maintainable. You be the judge.