C9 Lectures: Dr. Ralf Lämmel - Advanced Functional Programming - Type Classes

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<img src="http://ecn.channel9.msdn.com/o9/ch9/7020/567020/C9LecturesRalfLaemmelAFPTypeClasses_85_ch9.png" border="0" />Welcome to another series of  http://channel9.msdn.com/tags/C9+Lectures" target="_blank C9 Lectures covering http://channel9.msdn.com/tags/functional+programming" target="_blank functional programming . For this series,  http://www.uni-koblenz.de/~laemmel/Site/Bio.html" target="_blank Dr. Ralf Lämmel has generously taken the time to produce videos for Channel 9 from his office at the University of Koblenz-Landau (Germany), where he is a professor of computer science. The idea here is to take the next step from Erik Meijers fantastic introductory series on functional programming. Accordingly, Ralfs series will dive into more advanced areas of functional programming, again focusing on the Haskell language (the functional concepts discussed here, however, span beyond any one functional language).

In this second lecture in the series, Ralf digs into Type Classes , which are type system constructs that enable ad hoc polymorphism. Type classes amount to an intriguing element of the Haskell language, which is, for example, evident in their ability to solve the Expression Problem (make sure you watch Ralfs first lecture on this subject). Furthermore, type classes directly relate to the interface notion of mainstream OO programming, adding important expressiveness to C#/Java-like interfaces.
Type classes also take functional or declarative programming to a whole new level—one may define relations and functions pointwisely on types. That is, in the same way a regular function pattern matches on value structure, a type-level function sort of matches on type-definitional structure. This is quite a mouthful, I know.

There are various extensibility scenarios in the neighborhood of the Expression Problem that are interesting to consider from a design perspective, including several also addressable with type classes, and others that arent. Look for the riddles (there are indeed several riddles in this lecture); many of them call for a discussion, rather than a straight solution. But beware—some of them are really difficult.
See http://channel9.msdn.com/shows/Going+Deep/C9-Lectures-Dr-Ralf-Laemmel-Advanced-Functional-Programming-The-Expression-Problem/" target="_blank Lecture 1 - The Expression Problem
<img src="http://channel9.msdn.com/567020/WebViewBug.aspx?EVT=0" height="1" width="1" alt="" />

View the full article
 
Back
Top