leanprover / leanprover/fp-lean

Minor suggestion/observation for Ch 5

Open
#161 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Confusing
Dominant language
Lean
Stars
192
Forks
73
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the first section of Chapter 5 and the discussion of coercions in section 4.6, focusing on the andThen and firstThird example. Add a note explaining why some is written in this context, and confirm that the explanation resolves the question about omitted constructors.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.