anchpop / wise_mans_haskell

Free book for learning Haskell
https://andre.tips/wmh/
48 stars 5 forks source link

Chapter Feedback #10

Open anchpop opened 5 years ago

anchpop commented 5 years ago

If a chapter was boring or difficult to understand, I consider that a bug, since concepts in Haskell are neither. If any chapter seems to require real work to understand on your part, or you found it to tedious/verbose, let me know here.

unhammer commented 5 years ago

Under https://andre.tips/wmh/when-things-might-go-wrong/ , -- maybeAddOne.hs has

maybeAddOne :: (Num a) => Maybe a -> Maybe a

but then it says

Remember how we did Maybe Int? We could just as easily have changed the type signature to look like this: maybeAddOne :: (Num a) => Maybe a -> Maybe a

… as if the first snippet should say Int instead of a?


Also, an example says

*Main> first = maybeHead ([1,2,3] :: [Int])

but then

You’ll notice that we don’t have a case for if first is Nothing.

which doesn't follow

unhammer commented 5 years ago

https://andre.tips/wmh/creating-new-data-types/ says "The typeclasses you can automatically derive are Eq, Ord, Enum, Bounded, Show, and Read." – shouldn't that be prefixed with "By default, …" or something? People are deriving all kinds of stuff these days.

anchpop commented 5 years ago

Thanks for catching these, errors like the first one are really easy to make when editing. Should be fixed now.

unhammer commented 5 years ago

heh, also https://andre.tips/wmh/recursion-practice/ says length.hs but then contains ShowFrench

anchpop commented 5 years ago

I'll get that fixed asap, thanks @unhammer!

wongjoel commented 5 years ago

https://andre.tips/wmh/creating-new-data-types/

Spotted 2 Typos in this section:

Typo 1

Just before the "type aliases" header there is a random a*b*3*4 in the text

...
*a *    * b* 3 * 4

## Type Aliases
...

Typo 2

When explaining the Functor typeclass in the context of explaining Kinds, there is a missing word in the sentence: ("and it later an a")

The `f` *represents a type constructor*, and it later an `a` (which can be of any type) and returns a concrete type
anchpop commented 5 years ago

@wongjoel, I fixed this but I forgot to let you know! thanks for the help

wongjoel commented 5 years ago

Thanks @anchpop.

I found a broken link in "13 recursion practice". The second exercise is to rewrite using guards, but the link to guards doesn't work because it is looking for a section called guards on that page, instead of whatever chapter it is actually in.

anchpop commented 5 years ago

Should be fixed now, thanks

On Mon, Dec 17, 2018 at 6:01 PM Joel Wong notifications@github.com wrote:

Thanks @anchpop https://github.com/anchpop.

I found a broken link in "13 recursion practice". The second exercise is to rewrite using guards, but the link to guards doesn't work because it is looking for a section called guards on that page, instead of whatever chapter it is actually in.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/anchpop/wise_mans_haskell/issues/10#issuecomment-448031791, or mute the thread https://github.com/notifications/unsubscribe-auth/ADigRyt_1TdfCr75yQ2kzlnBYcGe1YV7ks5u6CJTgaJpZM4YMioy .

wongjoel commented 5 years ago

In the "Writing Real World Haskell Programs" chapter, there is a stray "git c" in the section on do notation.

To do this using do, there's an extra piece of notation we need. It looks like a backwards arrow: <-!marginnote(It's totally unrelated to the forward arrow in a lambda (\x ->).).git c

wongjoel commented 5 years ago

In the "Writing Real World Haskell Programs" chapter, there is a missing word in the explanation of the openFile function: (Probably should be "Let's see how to read a file.")

When you're done with the file, run hClose on the handle to tell the computer you don't need it anymore. Let's how to read a file.

wongjoel commented 5 years ago

In the "Writing Real World Haskell Programs" chapter, there are some punctuation formatting issues in the explanation of the sequence function.

  1. The margin note ends with a / instead of the expected .
  2. The comma immediately after the margin note ends up being displayed with a space, so in the website text it displays as This is an interesting function , what it

This is an interesting function!marginnote(We won't display sequence's type signature because it's a little complicated/), what it does is take a list of IO actions and return an IO action that executes all of them.

anchpop commented 5 years ago

@wongjoel thank you very much for your contributions! and I apologize for the brief outage earlier, had some issues with digitalocean

wongjoel commented 5 years ago

Thanks, @anchpop it's been great working though the book, I've been learning a lot. I've found it encouraging that you're been so responsive in fixing the minor typographical issues too.

A styling issue in the "Writing Real Haskell Programs" section: There is a !media command that is being included in the text literally instead of applying a style. I imagine that !media is supposed to be either !sidenote or !marginnote.

!media(Luckily GHC is smart enough to simplify this and not actually do anything.).

anchpop commented 5 years ago

@wongjoel thanks for reporting that. sorry for the delay, I've been a bit wrapped up by the new semester and christmas celebrations. that issue should be fixed now :)