[Haskell wikibook] Re: Truth values and a couple other things

Heinrich Apfelmus apfelmus at quantentunnel.de
Sat May 29 15:58:49 EDT 2010

Daniel Mlot wrote:
> While trying to think about how I could tackle the section on numerical
> types in "Type basics" I found out that I couldn't reason properly about
> it without knowing to which extent types would be discussed in the
> previous sections. That led me to "jump the gun" and attempt writing the
> bulk of the section myself. Apfelmus, please forgive me if that bothers
> you in any way (for instance, if you had a draft of your own being
> prepared) - in any case, just as I took some liberties with your outline
> feel free to do the same and turn my text upside down if you feel the
> need to :)

Sure, no problem. :) Eric Kow once remarked that the wikibook is a
"do-ocracy" which means that by doing something, like writing a chapter
or making a change, you automatically get the right to do it.

By the way, a principle that has helped me in my writing is that I try
to keep it really short, even minimize the number of words I use to make
a point. Great for clarity and readability, though a bit dry at times. I
always imagine that I'm writing for a reader whose attention is really
low and lasts only one additional paragraph, which is probably indeed
the case for any reader after a certain amount of time. :)

> I will use this message to register some issues that are roaming in my
> mind lest I forget to mention them:
> * Since we are reorganizing and rewriting most of the first chapters
> anyway it could be a good opportunity to standardize the style of code
> blocks. One option would be just using <source> tags everywhere to get
> syntax highlighting (with recent changes to the Wikibooks CSS files
> <source> is also bundled with the standard grey background box). There
> would be a couple possible issues to consider, though. We would probably
> have to do some template engineering, although I don't think that would
> be too troublesome. Another source of annoyance would be that GHCi
> printouts, ubiquitous on the early chapters, wouldn't be subject to the
> same standardization. Finally, there is the didactic concern of whether
> highlighting can be distracting for complete newbies during the first
> few modules (I do not have a really strong position on the subject but
> feel that "plain" plain text does have some charm due to sheer
> simplicity and transparency).

The GHC user's guide uses different colors: green for source listings
and red for GHCi examples (or the other way round).

The only reason I don't use <source> tags is because I'm too lazy to
type them out. :) The <code> tags are already too much for my taste.

> * One thing that occurred to me while writing about guards: is it even
> accurate to speak of our if/else and related constructs as "control
> structures"? Even if it is correct, is there any better term to use -
> one that does not have such imperative undertones?

Strictly speaking, there is no control flow in Haskell, so the term
"control structure" does not apply. I'd call it "case analysis" or
"definition by cases" instead.

Heinrich Apfelmus


More information about the Wikibook mailing list