[Haskell wikibook] Cheat sheet
apfelmus at quantentunnel.de
Mon May 17 10:41:13 EDT 2010
Daniel Mlot wrote:
> Heinrich Apfelmus wrote:
>> I'm still a bit hazy on the cheat sheet chapter, because it needs to do
>> several things simultaneously:
>> * introduce each category and mention which functions are important and
>> which are not; pointing to more detailed discussion for lists and IO
>> * present a quick overview list of the functions
>> * give a slightly more detailed account of each function
>> The idea is that the reader is given some exercises and he'll have to
>> hunt the right functions for these tasks.
> I set up a mock-up cheat sheet at
> . I structured it thinking on one appendix (or several ones) linked from
> the main "Building a vocabulary" module, where the more verbose
> discussions would be. The infrastructure could be easily adapted to
> different schemes, of course. Writing good and precise one-line
> descriptions of functions can be tricky (for instance, in my examples I
> don't like the way I described the folds and scans), but at least it
> looks neat.
> PS: Apfelmus: Nice thought to have added examples to the cheat sheets.
> I only fear they can grow a bit too wide sometimes, but in such cases
> nothing stops us from putting a "see on the detailed explanation" note
> there :)
An example is worth more than a hundred words. ;) I think they make
excellent one-line explanations. In fact, I'm unsure whether it's a good
idea to write more detailed explanations at all, I'd rather link to the
official documentation for that.
Also, I'm unhappy with the current markup we have to use. It's much
easier to specify it in "pseudo haddock markup"
-- | Last element.
-- > last [1,2,3] = 3
last :: [a] -> a
-- | Number of elements.
-- > length [True, False] = 2
length :: [a] -> Int
and have a Haskell program translate that to wikitext or any other format.
More information about the Wikibook