patrick-kidger / patrick-kidger/typsy
`safe-state.update` doesn't work with unnamed function
Open
Nobody has claimed this yet.
- Dominant language
- Typst
- Stars
- 30
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
#let a = state("state", 5)
#a.update(n => n + 5)
#context assert.eq(a.get(), 10)
#import "@preview/typsy:0.2.0"
#let a = typsy.safe-state(() => {}, 5)
#(a.update)(n => n + 5)
#context assert.eq((a.get)(), 10) // Failed assertion.
Contributor guide
No contributing guide indexed for this repository
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
Reproduce the issue with the provided Typst snippet, comparing the working state("state", 5) update with typsy.safe-state and its unnamed function. Trace how safe-state exposes update and get, then verify that applying n => n + 5 makes the final assertion evaluate to 10.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100