[Haskell-cafe] Re: [Haskell] Another First course in Haskell
waldmann at imn.htwk-leipzig.de
Sat Aug 23 08:41:08 EDT 2008
Piyush P Kurur wrote:
( http://article.gmane.org/gmane.comp.lang.haskell.general/16390 )
> I am planing a haskell based functional programming course.
> It is supposed to be a first course and I intend to show how
> real world applications can be built quite easily in haskell.
> Any feed back is really welcome.
Is it a first course in programming, or in functional programming?
Either way, I recommend focus on "data" and then "class/instance",
i.e. have the students use algebraic data types
right from the beginning (*).
Another idea for teaching is to introduce the language
by having the students use standard libraries (e.g. Data.Map),
also right from the start. So they are forced to
read type signatures etc. (**)
(*) that's the main problem I see with Hutton's book
it has "Declaring types and classes" as chapter 10 (of 13 total).
I think that's way off - and it leaves readers (students)
with the impression that declarative programming
basically deals with (functions on) lists.
This may have been true in the 70s/80s (LISP, Prolog),
but it certainly shouldn't be true today.
Recall the proverb "Get your data structures correct first,
and the rest of the program will write itself."
(David Jones, cited in John Bentley: More Programming Pearls)
I think this is independent of language and paradigm.
(**) again, Hutton's book does not contain a single "import" declaration
in the programming examples (did not check fully,
but got this impression while browsing).
Yes , Data.* is not Standard Haskell(98) and that's probably why he
avoided it but the result diametrically contradicts everyday programming
experience where the typical application program (in any language)
is just some glue between library functions that do 90 percent of the
Sure, a student programmer must be able to write
a stand-alone bubble/quick/mergesort but it is equally (if not more)
important that he knows how to (1) find and (2) call a sorting routine
in any given programming environment.
(So, have your students use http://www.haskell.org/hoogle/ )
Best regards, J.W.
More information about the Haskell-Cafe