ANNOUNCE: Draft TOC of Haskell in a Nutshell

Brook Conner nellardo@concentric.net
Tue, 09 Jan 2001 11:55:11 -0500


Ketil Malde wrote:

> Let's see.  It all depends on what you put into the chapters, of
> course, but you seem to jump directly from simple concepts into
> Haskell for web servers.  Wouldn't it be better to push this further
> out, until at least some of the syntax has been explored?

The second chapter is meant to be a brief overview of some of the ways 
you can execute Haskell code. For a programmer familiar with some of the 
more common languages (C++, Java, Perl is the kind I'm expecting), 
showing them right off the bat that Haskell *can* be used in web servers 
seemed like a good idea. It met two goals:

a) this list's objective in spreading the good word about how useful 
Haskell is :-)

b) the objective of "Nutshell" books to let experienced people transfer 
their existing skills as quickly as possible.

> >From the headlines, one might get the impression that type
> declarations are only important when the compiler can't figure it out
> itself - I'm sure the actual text will give a different view, no?

Of course - I have something of an informal writing tone when I'm 
writing for education, and some of the headlines reflect that (I mean, 
really, "hash"? :-) ) But part of what I was trying to do was to get 
some key concepts across to two different audiences of programmers:

a) the Perl programmers, who have types but generally don't ever write 
them down. These people will like type inferencing - it will seem more 
natural to them.

b) the C++ and Java programmers. They'll be just fine declaring types - 
showing them how to get strong typing without necessarily declaring the 
types explicitly will seem nifty cool to them (it did to me, ten years 
ago :-) )

I'm not about to get into any of the old arguments about static vs 
dynamic typing or that stuff - been there, done that. Haskell is a 
strongly typed language, and that will be apparent in the text.

> The cookbook looks great, and it's certainly something I'd buy the

Do you think the cookbook would be better as its own book?

>  I can, of course, think of many kinds of example programs
> I'd like to see - how about a GUI oriented program, for instance?

Actually, last night after sending the announcement, I added exactly 
that :-)

Years and years ago, Paul Haeberli of SGI implemented this cute little 
hack of having a brush attached to the cursor with a spring - real 
simple - moving the mouse changed the velocity vector of the brush, with 
settable strength and inertia and such. It made it insanely easy to 
produce a swooping, calligraphic stroke. Haeberli did it in C to OpenGL 
- using Fran, it would be perhaps a one-liner.

Scott Snibbe, then of Brown University, did another cute hack that 
showed up at SIGGRAPH later under the name "MotionPhone". He set up a 
loop of screen buffers that ran at a constant frame rate. As you drew, 
your mouse left behind moving streaks. Faster motion, longer streaks. 
This would be another one-liner with Fran (Scott originally did it in C 
to Pixrect, Sun's ancient direct screen access API).

I figured those kinds of examples showed off the power of Haskell.

> Perhaps you could finish it off with a "real" application, say a GUIed
> JPEG viewer, where you sort of string it all (the JPEG codec, a C
> library interface for something or other, and GUI stuff, etc.)
> together into a whole? 

This morning I've been thinking about data visualization from an SQL DB....

> On the whole, I think it looks good.  Best of luck!

Thanks!

Brook