Unify read accessors: get on signals, get_state on states - #3
Merged
tiensonqin merged 1 commit intoSep 24, 2026
Merged
tiensonqin merged 1 commit into
tiensonqin merged 1 commit into
Conversation
Signal.get previously accepted only 'v state, so Signal.get on a bare 'v signal was a type error and callers had to discover Signal.sample. Now: - Signal.get : 'v signal -> 'v (alias of sample; the common case) - Signal.get_state : 'v state -> 'v (former get) sample is unchanged. Callers of get on a state switch to get_state.
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Signal.getaccepted only'v state— calling it on a bare'v signalwas a type error, so consumers had to discoverSignal.samplefor the common case (hit twice while building on LUI; see the LUI problems list, P-3).Now the read verb is uniform:
Signal.get : 'v signal -> 'v— alias ofsample(the common case).Signal.get_state : 'v state -> 'v— whatgetused to do.sampleunchanged.Breaking for
Signal.get stcallers — the error points atget_state. Updated all internal/test call sites;dune buildzero warnings, 19/19 tests green. Stacked ondevin/declare-melange-dependencyso the melange dep fix stays in place for consumers pinning this sha.Link to Devin session: https://app.devin.ai/sessions/372c486fe4ae4b0894c194b3ca0509c1
Open in Devin Desktop: https://app.devin.ai/desktop/session/372c486fe4ae4b0894c194b3ca0509c1?variant=devin
Requested by: @tiensonqin