[Haskell-cafe] Re: Tutorial uploaded
sebastian.sylvan at gmail.com
Wed Dec 21 10:19:26 EST 2005
On 12/21/05, Wolfgang Jeltsch <wolfgang at jeltsch.net> wrote:
> Am Dienstag, 20. Dezember 2005 20:07 schrieb Sebastian Sylvan:
> > [...]
> > It's sometimes beneficial to "lie" a bit when starting out. Perhaps
> > say something like "this is a simplified view of things, for all the
> > gory details see chapter 19".
> > Monadic IO is pretty darn cool, sadly that means that many tutorial
> > authors are tempted to spend pages upon pages explaining exactly why
> > it's cool and how it works, but that is NOT what most people starting
> > out with the language need to read.
> > I'm still looking for a good *practical* tutorial that I could
> > recommend to newcomers.
> > IO, data types and QuickCheck in the very first chapter, I say! Real
> > program examples from the get go, and go into the theory on why this
> > has been hard in FP before Haskell (or Monadic IO rather) much much
> > later, so as to not scare people away.
> I think that there are cases where it's better to start with ordinary
> functional programming and come to I/O later. In my opinion, an example case
> would be teaching Haskell at a university.
Well, I certainly disagree there.
I'm not advocating going into a full-blown explanation of monads, just
enough to actually be able to write a real stand-alone program after
the first chapter. They only need to know that do-notation is for
sequencing computations, and (<-) is for binding a name to the result
of a computation. That's it!
You could spend the next ten chapters with coding examples that are
not very IO-heavy, and lead with a good example of doing as much as
possible in the pure world (as well as pointing out every now and then
whenever a particularly good "IO-separtion" was achieved - to
emphasize that it's good practice).
When someone who has programmed before learns Haskell and gets the
impression that IO is beeing left for later because it's "hard" they
might think "bah, what a rubbish language, IO in Visual Basic isn't
hard at all!".
More information about the Haskell-Cafe