Skip to content

[64.2] Strategy<T>: add | operator for OneOf composition#130

Merged
kommundsen merged 1 commit intomainfrom
feat/64-125-pipe-operator-oneof-composition
Apr 10, 2026
Merged

[64.2] Strategy<T>: add | operator for OneOf composition#130
kommundsen merged 1 commit intomainfrom
feat/64-125-pipe-operator-oneof-composition

Conversation

@kommundsen
Copy link
Copy Markdown
Owner

@kommundsen kommundsen commented Apr 10, 2026

Description

Adds a | operator to Strategy<T> via a C# 14 extension block, enabling concise OneOf composition: a | b | c produces OneOf(OneOf(a, b), c) (left-associative). The operator delegates to the existing Generate.OneOf method.

Type of change

  • New feature / strategy

Checklist

  • dotnet test src/ passes
  • New behavior is covered by tests (TDD: Red → Green → Refactor)
  • Follows .editorconfig code style

Closes #125
Part of #64

  - C# 14 extension operator delegating to Generate.OneOf(left, right)
  - Left-associative: a | b | c produces OneOf(OneOf(a, b), c)
@kommundsen kommundsen force-pushed the feat/64-125-pipe-operator-oneof-composition branch from 6268363 to 481231d Compare April 10, 2026 20:13
@kommundsen kommundsen merged commit 82196d7 into main Apr 10, 2026
1 check passed
@kommundsen kommundsen deleted the feat/64-125-pipe-operator-oneof-composition branch April 10, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[64.2] Strategy<T>: add | operator for OneOf composition

1 participant