Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor suggestion/observation for Ch 5 #161

Open
TomasPuverle opened this issue Sep 19, 2024 · 1 comment
Open

Minor suggestion/observation for Ch 5 #161

TomasPuverle opened this issue Sep 19, 2024 · 1 comment
Labels
Confusing A description is technically correct but doesn't effectively communicate to the target audience

Comments

@TomasPuverle
Copy link

Reading the first section of Ch 5 with the andThen code, I see e.g.

def firstThird (xs : List α) : Option (α × α) :=
  andThen xs[0]? fun first =>
  andThen xs[2]? fun third =>
  some (first, third)

Given that I just finished Ch 4 (esp. 4.6 on coercions) where it says "This allows option types to be used in a manner even more similar to nullable types, because some can be omitted", I am wondering why I have to/should say some in the code above. Would you consider adding a note on this? Thanks!

@TomasPuverle TomasPuverle changed the title Minor suggestion/observation Minor suggestion/observation for Ch 5 Sep 30, 2024
@david-christiansen david-christiansen added the Confusing A description is technically correct but doesn't effectively communicate to the target audience label Oct 1, 2024
@david-christiansen
Copy link
Collaborator

Absolutely, this is a great suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Confusing A description is technically correct but doesn't effectively communicate to the target audience
Projects
None yet
Development

No branches or pull requests

2 participants