Posted By: Charles | Oct 15th @ 8:46 AM | 43,470 Views | 53 Comments
We've kicked off C9 Lectures with a journey into the world of Functional Programming with functional language purist and high priest of the lambda calculus, Dr. Erik Meijer (you can thank Erik for many of the functional constructs that have shown up in languages like C# and VB.NET. When you use LINQ, thank Erik in addition to Anders). 

We will release a new chapter in this series every Thursday.

In Chapter 3, Dr. Meijer explores types and classes in Haskell. A type is a collection of related values and in Haskell every well-formed expression has a type. Using type inference, these types are automatically calculated at run time. If expression e returns a type t, then e is of type t, e :: t. A function is a mapping of one type to another type and you will learn about new types of functions in this lecture, specifically curried functions: functions that return functions as a result (and functions are values, remember) and polymorphic functions (function with a type that contains one or more type variables).

You should watch these in sequence (or skip around depending on your curent level of knowledge in this domain):

Chapter 1
Chapter 2

Now, we do have a textbook and you should go buy it: The great Graham Hutton's Programming in Haskell. We worked with the publisher, Cambridge University Press, to get all Niners a 20% discount on the book. Now, you don't need the book to learn a great deal from this lecture series since Graham's website has all the slides and samples from the book as well as answers to the exercises. That said, it's highly recommended reading and you should consider it.

The promotion code is 09HASK and it is vaild on both the Hardback:

9780521871723 and Paperback: 9780521692694. The catalog pages are:

Hardback:

http://www.cambridge.org/us/catalogue/catalogue.asp?isbn=9780521871723 and the paperback is:

http://www.cambridge.org/us/catalogue/catalogue.asp?isbn=9780521692694

Note: This special offer is valid until December 31, 2009

Rating:
14
0
exoteric
exoteric
I : Next<I>

Erik, can you explain a little about the pseudo "for all" notation you mentioned - why would you use it, when would you not use it?

Will we get a video today?

Justin, that is one cool cheat sheet. Thanks!

Radu

@DrErikMeijer: .Net has a Pair class, It's tucked away in the System.Web.UI namespace

I believe from the book or the video that classes are, as types, inferred.

For example, in exercise 2 the type double accept a Num a class constraint as argument; it's unclear if it is inferred from the operator * , the number 2 or both.

How does it work effectively?

Excellent series so far.  As mentioned previously, I am looking forward to seeing a "real" haskell program.

Microsoft Communities