anchpop / wise_mans_haskell

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

Typo in "Getting Started" (myProgram.hs) #13

Closed wongjoel closed 5 years ago

wongjoel commented 5 years ago

In the first code snippet of myProgram.hs, there is a typo in the definition addTwo x = addone (addone x).

addone has not been previously defined, but addOne has been. Trying to load the file in ghci as requested provides a nice error message suggesting that this is the problem, but I wonder if this is the intended point of that part of the text? (It's the first time the user has been asked to load in a *.hs file into ghci)

Copied the code snippet for convenience (since I can't work out how to link to the actual file in the repo)

-- myProgram.hs
addOne :: Int -> Int
addOne x = x + 1

addTwo :: Int -> Int
addTwo x = addone (addone x)
anchpop commented 5 years ago

That was definitely not the intention! Should be fixed, thanks. I really need to setup a way to test all the test programs at once to be sure they compile

wongjoel commented 5 years ago

Typo fixed, thanks!