sealing `IO` and `EIO`
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
IO (and EIO) internal implementation is still transparent.
https://github.com/leanprover/lean4/blob/151e87751301e22bb05691ac630e50b4bfec8ac5/src/Init/System/IO.lean#L15-L28
So, users can write bogus code that tries to "capture" IO.RealWorld.
@Kha this is not a high priority issue, but I can see users complaining about this all the time.
We can seal the implementation using the same approach we used to seal EnvExtension:
https://github.com/leanprover/lean4/blob/151e87751301e22bb05691ac630e50b4bfec8ac5/src/Lean/Environment.lean#L142-L149
https://github.com/leanprover/lean4/blob/151e87751301e22bb05691ac630e50b4bfec8ac5/src/Lean/Environment.lean#L239-L249
However, it is very verbose.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Init/System/IO.lean at the linked IO and EIO definitions, then read the sealing pattern in src/Lean/Environment.lean at the referenced EnvExtension sections. Confirm that the implementation is no longer transparent and that users cannot capture IO.RealWorld while preserving the existing IO and EIO interfaces.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100