Remove Dummies implicit generator conversions (ADR-0020) - #194
Merged
Conversation
Record the decision to drop the implicit generator conversions and make Generate() the single materialization, taken before the standalone Dummies package reaches a stable 1.0. Drafted as Proposed for the maintainer to accept; the implementation lands separately. Refs: #190 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011NjuZBGDpqfLRvqzVPt34T
The concrete generators defined an implicit conversion to their generated type. That conversion draws randomness, can throw, and yields a fresh value on every run — an effectful, non-idempotent call disguised behind an assignment, which contradicts the recipe-versus-value model the library teaches, and which fires only in explicitly-typed contexts while silently passing the generator under var, object, params object[], generic inference and overload resolution. Generate() already materializes uniformly in every context and is the path the As/Combine seams use, so removing the operators loses no capability. The package is pre-1.0, standalone and referenced only by its own tests, so this is the cheapest moment to settle the contract. Documentation and tests are updated to present Generate() as the sole materialization. See ADR-0020. Refs: #190 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011NjuZBGDpqfLRvqzVPt34T
The maintainer accepts the decision to drop the implicit generator conversions and materialize dummies only through Generate(). Flip the status from Proposed to Accepted in both language versions and the index. Refs: #190 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011NjuZBGDpqfLRvqzVPt34T
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
Remove the implicit conversions on the concrete
Dummiesgenerators and makeGenerate()the single way to materialize a value. The conversion drew randomness, could throw, and returned a fresh value on every run — an effectful, non-idempotent call disguised behind an assignment — and it fired only in explicitly-typed contexts while silently passing the generator undervar,object,params object[], generic inference and overload resolution.Generate()already covers every context uniformly, so nothing is lost. Decided and recorded in ADR-0020 while the package is still pre-1.0.Type of change
Changes
operatordefinitions across the concrete generators — the simple types and theList<T>/T[]/HashSet<T>/Dictionary<TKey,TValue>collection generators.IAny<T>now statesGenerate()is the single materialization;AnySequence's "unlike the other collection generators" note andAnyCollection.ContainingAny's ambiguity rationale (both premised on the now-removed conversion) are corrected.Dummies/README.nuget.mdto materialize with.Generate().Dummies.UnitTeststo.Generate(); replacedImplicitConversionTestswithMaterializationTests(materialization, call-site, fresh value per call, generic inference throughIAny<T>).Testing
dotnet build FirstClassErrors.slndotnet test FirstClassErrors.slnFirstClassErrors.Analyzers.UnitTests)Documentation
doc/updateddoc/handwritten/for-users/README.fr.md) updated if user-facing behavior changedArchitecture decisions
Proposed: ADR-0020Related issues
Closes #190
Generated by Claude Code