Repository navigation
Take the error case first in Result.Match and Result.Switch - #1041
Open
FreeApophis wants to merge 1 commit into
Open
FreeApophis wants to merge 1 commit into
FreeApophis wants to merge 1 commit into
Conversation
Result<T>.Match(ok, error) and Switch(ok, error) become Match(error, ok) and Switch(error, ok), consistent with Option.Match(none, some) and Either.Match(left, right). Both carry [UseWithArgumentNames], so every call in the repository already names its arguments and survives the swap; the PublicAPI files record the old and the new signatures. The alternative monad analyzer no longer assumes a position for Result's error-state argument but finds it by parameter name, so Funcky.Analyzers 3.0.0 works with Funcky 3.x and 4.0.0 alike. The documentation examples show the error case first. Closes #683 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This branch has not been deployed
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.
Closes #683. Stacked on #1040 (base
async-2-0), retarget once the chain #1037 → #1039 → #1040 has merged.Result<T>.Match(ok, error)→Match(error, ok),Switch(ok, error)→Switch(error, ok), and the internal totalMatch(uninitialized, error, ok), as settled in the grooming of 21 Oct 2026. Every call in the repository names its arguments (λ1003), so none of them changed; the PublicAPI Unshipped files of all six Funcky assets get the two*REMOVED*lines and the two new ones.AlternativeMonadAnalyzer(λ1005 to λ1007, λ1011) found Result's error-state argument by position (matchHasSuccessStateFirst). It now looks it up by parameter name (none,left,error), so Funcky.Analyzers 3.0.0 gives the same results against Funcky 3.x and 4.0.0. The analyzer test stubs mirror the 4.0.0 order; the existing tests already callMatchwith the arguments in both orders.Verified locally: Release build of the solution with
TreatWarningsAsErrors, Funcky.Test on all four frameworks, Funcky.Xunit and Funcky.Xunit.v3 tests, Funcky.Async.Test, and Funcky.Analyzers.Test 262/262.🤖 Generated with Claude Code