Skip to content

Example that does not compile and uses several new, unexplained concepts #137

@fuxoft

Description

@fuxoft

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions