Subscribe to
Posts
Comments

A number of reviewers have asked about chapters that have not yet been heavily commented upon. Here’s a table that indicates the current state of play for all of the beta chapters we have published so far. It’s ranked by the ratio of the number of paragraphs in a chapter to the number of comments for that chapter. A lower ratio indicates that a chapter needs more attention.

I’ve marked chapters 1 through 11 in bold. If a chapter is marked bold and has a low ratio, we’d be really happy to see it get more attention, because we’ll be shipping it to the production team soon. Thanks!

Chapter Paragraphs Comments Ratio
6. Writing a library 227 31 0.14
17. Monad transformers 151 32 0.21
16. Programming with monads 222 51 0.23
15. Monads 338 121 0.36
5. Functional programming 382 140 0.37
11. Code case study: parsing a binary data format 170 64 0.38
10. I/O case study: a library for searching the filesystem 207 78 0.38
14. Data structures 189 82 0.43
9. Case study: regular expressions and file name matching 174 89 0.51
8. Input and output 218 152 0.70
4. Defining types, streamlining functions 301 284 0.94
22. Working with databases 76 77 1.01
7. Using typeclasses 98 122 1.24
3. Types and functions 274 392 1.43
1. Why functional programming? Why Haskell? 131 209 1.60
2. Getting started 148 342 2.31

2 Responses to “Comment coverage, and how to help us most”

  1. on 26 Jun 2008 at 07:52 America/New_YorkGal Amram

    Chapter 9: I/O
    “Notice in str2action the use of the standard function composition operator. In main, there’s a call to mapM_. This function is similar to map. It takes a function and a list. ###The function supplied to mapM_ is an I/O action### that is executed for every item in the list. mapM_ throws out the result of the function, though you can use mapM to return a list of I/O results if you want them. Take a look at their types: “

    Isn’t it supposed to be:
    ###The function supplied to mapM_ *returns* an I/O action###

    we can write in ghci:
    let x = mapM_ (str2action . show) numbers

    the only reason mapM_ (str2action . show) numbers is “executed” in main is coz the action was extracted via the do notation.

    P.S.
    I’m a newbie.

  2. on 26 Jun 2008 at 08:29 America/New_YorkGal Amram

    “Why a mapM when we already have map? Because map is a pure function that returns a list. It doesn’t—and can’t—actually execute actions directly. mapM is a utility that lives in the IO monad and thus can actually execute the actions.[21]“
    Isn’t a function a -> IO () pure ? it always returns the same action; using an action resolve into unholy(pure) code.
    (Am I missing something ?)

    “Going back to main, mapM_ applies (str2action . show) to every element in numbers. show converts each number to a String and str2action converts each String to an action. ###mapM_ then takes care of executing each action, which results in a line printed out. ###”
    It seems that mapM_ only create a “big” action from the sequence of actions created by (str2action . show) on numbers – It doesn’t execute actions at all.

Leave a Reply