Hi Mark,<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-AU"><div>
<p>Just wondering if Generics and Parametric polymorphism are
one and the same in Haskell. <br></p>
<p>I read (somewhere!) an article stating that generics might be
included in Haskell Prime but I thought that they’re already included as
parametric polymorphism.</p></div></div></blockquote><div>To see the current status of Haskell Prime, visit the Trac page:<br><br> <a href="http://hackage.haskell.org/trac/haskell-prime/">http://hackage.haskell.org/trac/haskell-prime/</a> <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-AU"><div><p></p>
<p>Did I misread something? Or is generics in Haskell referring
to something completely different.</p></div></div></blockquote></div>I'm not sure which article you read, but there is a lot of ambiguity in the term "generics." Depending on whom you talk to, it means a different thing. But I can give you some pointers to where you can learn about many of the possible interpretations.<br>
<br>The following paper gives a useful vocabulary for describing the different types of "generics." Just by reading section 2 you can see how confusing it is when so many techniques are referred to as generic programming. For example, parametric polymorphism is an example of genericity by type here. In the Haskell world, (as Don said) it's not considered generics, but in Java (as Alp remarked), it's called generics.<br>
<br> <a href="http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/dgp.pdf">http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/dgp.pdf</a><br><br>There's a comparison paper from 2003 that presents language support for generics in C++, ML, Haskell, Eiffel, Java, and C#. Things have changed a bit since then, but it's an interesting read.<br>
<br> <a href="http://ece-www.colorado.edu/~siek/pubs/comparing_generic_programming03.pdf">http://ece-www.colorado.edu/~siek/pubs/comparing_generic_programming03.pdf</a><br><br>"Generics" in Haskell has come to be known as datatype-generic programming. In the past, it has been labeled polytypism, structural polymorphism, or typecase. This refers to the technique of writing functions or programs that work for many types and have knowledge about the structure of the type (mentioned by Bulat).<br>
<br>Generic Haskell is a (non-standard) language extension to Haskell. It was used to explore the possibilities of datatype-generic programming (DGP) with Haskell. The following paper compares varying approaches of DGP to Generic Haskell.<br>
<br> <a href="http://people.cs.uu.nl/johanj/publications/ComparingGP.pdf">http://people.cs.uu.nl/johanj/publications/ComparingGP.pdf</a><br><br>In the last few years, people have seen the power of Haskell's type system, and GHC has developed some interesting extensions to that type system. As a result of this and the difficulty with maintaining language extensions external to a compiler (e.g. Generic Haskell), libraries for DGP in Haskell have become much more common and powerful. The following article compares a large number of these libraries.<br>
<br> <a href="http://www.cs.uu.nl/wiki/Alexey/ComparingLibrariesForGenericProgrammingInHaskell">http://www.cs.uu.nl/wiki/Alexey/ComparingLibrariesForGenericProgrammingInHaskell</a><br><br>Lastly, since I started working in this area over a year ago, I've been collecting references to published research. My citations are on CiteULike:<br>
<br> <a href="http://www.citeulike.org/user/spl">http://www.citeulike.org/user/spl</a><br><br>There are tags for "generics" and "datatype-generic" that give you a narrower view on the collection.<br><br>
<a href="http://www.citeulike.org/user/spl/tag/generics">http://www.citeulike.org/user/spl/tag/generics</a><br> <a href="http://www.citeulike.org/user/spl/tag/datatype-generic">http://www.citeulike.org/user/spl/tag/datatype-generic</a><br>
<br>Hope this helps to answer your questions.<br><br>Regards,<br>Sean<br>