Is your content edit request related to a problem? Please describe.
In the syntax-in-function chapter, there is an example that does not compile "out of the box" and uses several new concepts without explaining them. It's the densityTell function that uses readMaybe.
Additional context
This example uses Just, Nothing and readMaybe which were not yet mentioned at this point in the book and are not explained here. As a beginner, I am also unsure how <- is supposed to work here, as I've only seen used it in list comprehensions in previous chapters. Additionally, on my fresh installation of GHCi 9.6.7, this example does not compile because readMaybe is undefined. This example should contain more detailed explanation of how it works or be moved to later chapter where those concepts are explained.
Link to the page in question
https://learnyouahaskell.github.io/syntax-in-functions.html
Is your content edit request related to a problem? Please describe.
In the
syntax-in-functionchapter, there is an example that does not compile "out of the box" and uses several new concepts without explaining them. It's thedensityTellfunction that usesreadMaybe.Additional context
This example uses
Just,NothingandreadMaybewhich were not yet mentioned at this point in the book and are not explained here. As a beginner, I am also unsure how<-is supposed to work here, as I've only seen used it in list comprehensions in previous chapters. Additionally, on my fresh installation of GHCi 9.6.7, this example does not compile becausereadMaybeis undefined. This example should contain more detailed explanation of how it works or be moved to later chapter where those concepts are explained.Link to the page in question
https://learnyouahaskell.github.io/syntax-in-functions.html