On Wed, Jun 8, 2011 at 2:00 AM, Malcolm Wallace
<malcolm.wallace@me.com> wrote:
> More seriously, the influence of Haskell over F# (and even Python) is undoubted, but do you really think Haskell influenced Java Generics? (IMHO they were more inspired from C++ templates)
> (That is a question, not an assertion).
Phil Wadler had a hand in designing both Haskell and Java Generics I believe.
As far as I understand, Java/C# Generics and C++ templates "are" merely keywords around what we Haskellers call "parametric polymorphism". In other words, our type language is rich enough to express types like:
stringConcat :: [String] -> String
and
concat :: Monoid a => [a] -> a
using the "same" typing language, whereas the C-style languages require annotations. (You can probably guess which I prefer. I don't need keywords to tell me what the code describes, then the code describes it so clearly)
I can't find any literature that specifically credits functional languages for the feature, but Bjarne Stoustrup himself acknowledges that functional programmers would tend to find template metaprogramming easier than others. He was probably aware of functional implementations (Haskell? Miranda? ML?) when he said that.
I don't see the connection between Haskell's typeful programming and Python. List comprehensions are set-builder-notation-like syntactic sugar for lists. I didn't use them in Python and I don't use them in Haskell.