Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ nested `IUnionMembers` explicitly so it stays out of the public API), `Valid.cs`
## Workflow

- Squash-merged PRs; the PR title is a Conventional Commit and the description says `Closes #n`. Versions come from git
tags via MinVer. Only three releases are planned (`1.0.0-alpha.1`, `1.0.0-beta.1`, `1.0.0`); release PRs are merged
by the maintainer. To force a release without `feat:`/`fix:`/`perf:`, merge with a `Release-As:` footer
tags via MinVer (1.0 came as `1.0.0-alpha.1`, `1.0.0-beta.1`, `1.0.0`; since then plain semver). Release PRs are
merged by the maintainer, and the public API in `PublicAPI.Shipped.txt` changes only with a major version. To force a release without `feat:`/`fix:`/`perf:`, merge with a `Release-As:` footer
(`gh pr merge --squash --body "Release-As: x.y.z"`).
- Cards are built test-first: failing tests plus `NotImplementedException` stubs, then implement until green.
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ compiler and check the diagnostics. They pin down how C# unions behave with `Val
Releases are automated with release-please and published to nuget.org with Trusted Publishing.

1. Every push to `main` updates an open *release PR* with the next version and the changelog. Work is planned in
GitHub milestones and issues; the release PR stays open across several milestones and is merged only at the three
release points of 1.0 (`1.0.0-alpha.1`, `1.0.0-beta.1`, `1.0.0`).
2. Merging the release PR tags the commit (`v1.0.0-alpha.1`, ...) and creates a GitHub release.
GitHub milestones and issues; the release PR stays open across several milestones and is merged at the release
points (1.0 itself came as `1.0.0-alpha.1`, `1.0.0-beta.1` and `1.0.0`).
2. Merging the release PR tags the commit (`v1.0.0`, ...) and creates a GitHub release.
3. The `publish` job (environment `release`, needs approval) packs the tagged commit and pushes it to nuget.org.

The package version comes from the git tag through MinVer; nothing else needs editing.
Expand All @@ -52,11 +52,11 @@ release with a `Release-As:` footer in the commit body. Pull requests are squash
message, so the GitHub UI drops footers; merge from the command line instead:

```bash
gh pr merge <number> --squash --subject "chore: start beta releases (#<number>)" --body "Release-As: 1.0.0-beta.1"
gh pr merge <number> --squash --subject "chore: release 1.1.0 (#<number>)" --body "Release-As: 1.1.0"
```

Until 1.0.0 the configuration produces pre-releases (`prerelease-type` alpha, then beta); 1.0.0 drops those settings,
and later versions follow plain semantic versioning (`fix:` → 1.0.1, `feat:` → 1.1.0, a breaking change → 2.0.0).
Since 1.0.0 the configuration has no pre-release settings: versions follow plain semantic versioning (`fix:` → 1.0.1,
`feat:` → 1.1.0, a breaking change → 2.0.0).

## Public API

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Applicative validation for C# 15 built on union types: a `Validated<T, TError>` is either a valid value or one or more
errors, and independent validations combine by accumulating every error instead of stopping at the first one.

> **Status:** 1.0 is a ground-up rewrite for .NET 11 and C# 15 unions, now in beta: the API is complete. The 0.5
> line is retired; see [Migrating from 0.5](#migrating-from-05).
> **Status:** 1.0 is a ground-up rewrite for .NET 11 and C# 15 unions. The 0.5 line is retired; see
> [Migrating from 0.5](#migrating-from-05).

```csharp
using DotValid;
Expand Down
4 changes: 1 addition & 3 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"release-type": "simple",
"include-v-in-tag": true,
"include-component-in-tag": false,
"versioning": "prerelease",
"prerelease": true,
"prerelease-type": "beta",
"prerelease": false,
"packages": {
".": {
"changelog-path": "CHANGELOG.md"
Expand Down
95 changes: 95 additions & 0 deletions src/DotValid/PublicAPI.Shipped.txt
Original file line number Diff line number Diff line change
@@ -1 +1,96 @@
#nullable enable
DotValid.Invalid<TError>
DotValid.Invalid<TError>.Deconstruct(out System.Collections.Immutable.ImmutableArray<TError> errors) -> void
DotValid.Invalid<TError>.Equals(DotValid.Invalid<TError> other) -> bool
DotValid.Invalid<TError>.Errors.get -> System.Collections.Immutable.ImmutableArray<TError>
DotValid.Invalid<TError>.Invalid() -> void
DotValid.Invalid<TError>.Invalid(params System.ReadOnlySpan<TError> errors) -> void
DotValid.Invalid<TError>.Invalid(TError error) -> void
DotValid.Prelude
DotValid.Valid<T>
DotValid.Valid<T>.Deconstruct(out T value) -> void
DotValid.Valid<T>.Equals(DotValid.Valid<T> other) -> bool
DotValid.Valid<T>.Valid() -> void
DotValid.Valid<T>.Valid(T value) -> void
DotValid.Valid<T>.Value.get -> T
DotValid.Validated
DotValid.Validated<T, TError>
DotValid.Validated<T, TError>.Ensure(System.Func<T, bool>! predicate, System.Func<T, TError>! error) -> DotValid.Validated<T, TError>
DotValid.Validated<T, TError>.Ensure(System.Func<T, bool>! predicate, TError error) -> DotValid.Validated<T, TError>
DotValid.Validated<T, TError>.Equals(DotValid.Validated<T, TError> other) -> bool
DotValid.Validated<T, TError>.IUnionMembers
DotValid.Validated<T, TError>.IUnionMembers.Create(DotValid.Invalid<TError> value) -> DotValid.Validated<T, TError>
DotValid.Validated<T, TError>.IUnionMembers.Create(DotValid.Valid<T> value) -> DotValid.Validated<T, TError>
DotValid.Validated<T, TError>.IUnionMembers.TryGetValue(out DotValid.Invalid<TError> value) -> bool
DotValid.Validated<T, TError>.IUnionMembers.TryGetValue(out DotValid.Valid<T> value) -> bool
DotValid.Validated<T, TError>.IUnionMembers.Value.get -> object?
DotValid.Validated<T, TError>.Map<TResult>(System.Func<T, TResult>! map) -> DotValid.Validated<TResult, TError>
DotValid.Validated<T, TError>.MapAsync<TResult>(System.Func<T, System.Threading.Tasks.Task<TResult>!>! map) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
DotValid.Validated<T, TError>.MapError<TNewError>(System.Func<TError, TNewError>! map) -> DotValid.Validated<T, TNewError>
DotValid.Validated<T, TError>.Match<TResult>(System.Func<T, TResult>! valid, System.Func<System.Collections.Immutable.ImmutableArray<TError>, TResult>! invalid) -> TResult
DotValid.Validated<T, TError>.MatchAsync<TResult>(System.Func<T, System.Threading.Tasks.Task<TResult>!>! valid, System.Func<System.Collections.Immutable.ImmutableArray<TError>, System.Threading.Tasks.Task<TResult>!>! invalid) -> System.Threading.Tasks.ValueTask<TResult>
DotValid.Validated<T, TError>.MatchAsync<TResult>(System.Func<T, System.Threading.Tasks.Task<TResult>!>! valid, System.Func<System.Collections.Immutable.ImmutableArray<TError>, TResult>! invalid) -> System.Threading.Tasks.ValueTask<TResult>
DotValid.Validated<T, TError>.OrDefault(System.Func<System.Collections.Immutable.ImmutableArray<TError>, T>! fallback) -> T
DotValid.Validated<T, TError>.OrDefault(T fallback) -> T
DotValid.Validated<T, TError>.Select<TResult>(System.Func<T, TResult>! selector) -> DotValid.Validated<TResult, TError>
DotValid.Validated<T, TError>.Then<TResult>(System.Func<T, DotValid.Validated<TResult, TError>>! next) -> DotValid.Validated<TResult, TError>
DotValid.Validated<T, TError>.ThenAsync<TResult>(System.Func<T, System.Threading.Tasks.Task<DotValid.Validated<TResult, TError>>!>! next) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
DotValid.Validated<T, TError>.Validated() -> void
DotValid.Validated<T, TError>.Zip<TOther, TResult>(DotValid.Validated<TOther, TError> other, System.Func<T, TOther, TResult>! combine) -> DotValid.Validated<TResult, TError>
DotValid.Validated<T, TError>.Zip<TOther>(DotValid.Validated<TOther, TError> other) -> DotValid.Validated<(T, TOther), TError>
DotValid.ValidationError
DotValid.ValidationError.Deconstruct(out string! Property, out string! Message) -> void
DotValid.ValidationError.Equals(DotValid.ValidationError other) -> bool
DotValid.ValidationError.Message.get -> string!
DotValid.ValidationError.Property.get -> string!
DotValid.ValidationError.ValidationError() -> void
DotValid.ValidationError.ValidationError(string! Property, string! Message) -> void
override DotValid.Invalid<TError>.Equals(object? obj) -> bool
override DotValid.Invalid<TError>.GetHashCode() -> int
override DotValid.Invalid<TError>.ToString() -> string!
override DotValid.Valid<T>.Equals(object? obj) -> bool
override DotValid.Valid<T>.GetHashCode() -> int
override DotValid.Valid<T>.ToString() -> string!
override DotValid.Validated<T, TError>.Equals(object? obj) -> bool
override DotValid.Validated<T, TError>.GetHashCode() -> int
override DotValid.Validated<T, TError>.ToString() -> string!
override DotValid.ValidationError.GetHashCode() -> int
override DotValid.ValidationError.ToString() -> string!
static DotValid.Invalid<TError>.operator !=(DotValid.Invalid<TError> left, DotValid.Invalid<TError> right) -> bool
static DotValid.Invalid<TError>.operator ==(DotValid.Invalid<TError> left, DotValid.Invalid<TError> right) -> bool
static DotValid.Prelude.invalid<TError>(params System.ReadOnlySpan<TError> errors) -> DotValid.Invalid<TError>
static DotValid.Prelude.invalid<TError>(TError error) -> DotValid.Invalid<TError>
static DotValid.Prelude.valid<T>(T value) -> DotValid.Valid<T>
static DotValid.Valid<T>.operator !=(DotValid.Valid<T> left, DotValid.Valid<T> right) -> bool
static DotValid.Valid<T>.operator ==(DotValid.Valid<T> left, DotValid.Valid<T> right) -> bool
static DotValid.Validated.Apply<T, TResult, TError>(this DotValid.Validated<System.Func<T, TResult>!, TError> function, DotValid.Validated<T, TError> argument) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Check<T, TError>(T value, System.Func<T, bool>! predicate, System.Func<T, TError>! error) -> DotValid.Validated<T, TError>
static DotValid.Validated.Check<T, TError>(T value, System.Func<T, bool>! predicate, TError error) -> DotValid.Validated<T, TError>
static DotValid.Validated.Combine<T1, T2, T3, T4, T5, T6, T7, T8, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, DotValid.Validated<T3, TError> third, DotValid.Validated<T4, TError> fourth, DotValid.Validated<T5, TError> fifth, DotValid.Validated<T6, TError> sixth, DotValid.Validated<T7, TError> seventh, DotValid.Validated<T8, TError> eighth, System.Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Combine<T1, T2, T3, T4, T5, T6, T7, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, DotValid.Validated<T3, TError> third, DotValid.Validated<T4, TError> fourth, DotValid.Validated<T5, TError> fifth, DotValid.Validated<T6, TError> sixth, DotValid.Validated<T7, TError> seventh, System.Func<T1, T2, T3, T4, T5, T6, T7, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Combine<T1, T2, T3, T4, T5, T6, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, DotValid.Validated<T3, TError> third, DotValid.Validated<T4, TError> fourth, DotValid.Validated<T5, TError> fifth, DotValid.Validated<T6, TError> sixth, System.Func<T1, T2, T3, T4, T5, T6, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Combine<T1, T2, T3, T4, T5, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, DotValid.Validated<T3, TError> third, DotValid.Validated<T4, TError> fourth, DotValid.Validated<T5, TError> fifth, System.Func<T1, T2, T3, T4, T5, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Combine<T1, T2, T3, T4, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, DotValid.Validated<T3, TError> third, DotValid.Validated<T4, TError> fourth, System.Func<T1, T2, T3, T4, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Combine<T1, T2, T3, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, DotValid.Validated<T3, TError> third, System.Func<T1, T2, T3, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.Combine<T1, T2, TResult, TError>(DotValid.Validated<T1, TError> first, DotValid.Validated<T2, TError> second, System.Func<T1, T2, TResult>! combine) -> DotValid.Validated<TResult, TError>
static DotValid.Validated.CombineAsync<T1, T2, T3, T4, T5, T6, T7, T8, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Threading.Tasks.Task<DotValid.Validated<T3, TError>>! third, System.Threading.Tasks.Task<DotValid.Validated<T4, TError>>! fourth, System.Threading.Tasks.Task<DotValid.Validated<T5, TError>>! fifth, System.Threading.Tasks.Task<DotValid.Validated<T6, TError>>! sixth, System.Threading.Tasks.Task<DotValid.Validated<T7, TError>>! seventh, System.Threading.Tasks.Task<DotValid.Validated<T8, TError>>! eighth, System.Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.CombineAsync<T1, T2, T3, T4, T5, T6, T7, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Threading.Tasks.Task<DotValid.Validated<T3, TError>>! third, System.Threading.Tasks.Task<DotValid.Validated<T4, TError>>! fourth, System.Threading.Tasks.Task<DotValid.Validated<T5, TError>>! fifth, System.Threading.Tasks.Task<DotValid.Validated<T6, TError>>! sixth, System.Threading.Tasks.Task<DotValid.Validated<T7, TError>>! seventh, System.Func<T1, T2, T3, T4, T5, T6, T7, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.CombineAsync<T1, T2, T3, T4, T5, T6, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Threading.Tasks.Task<DotValid.Validated<T3, TError>>! third, System.Threading.Tasks.Task<DotValid.Validated<T4, TError>>! fourth, System.Threading.Tasks.Task<DotValid.Validated<T5, TError>>! fifth, System.Threading.Tasks.Task<DotValid.Validated<T6, TError>>! sixth, System.Func<T1, T2, T3, T4, T5, T6, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.CombineAsync<T1, T2, T3, T4, T5, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Threading.Tasks.Task<DotValid.Validated<T3, TError>>! third, System.Threading.Tasks.Task<DotValid.Validated<T4, TError>>! fourth, System.Threading.Tasks.Task<DotValid.Validated<T5, TError>>! fifth, System.Func<T1, T2, T3, T4, T5, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.CombineAsync<T1, T2, T3, T4, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Threading.Tasks.Task<DotValid.Validated<T3, TError>>! third, System.Threading.Tasks.Task<DotValid.Validated<T4, TError>>! fourth, System.Func<T1, T2, T3, T4, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.CombineAsync<T1, T2, T3, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Threading.Tasks.Task<DotValid.Validated<T3, TError>>! third, System.Func<T1, T2, T3, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.CombineAsync<T1, T2, TResult, TError>(System.Threading.Tasks.Task<DotValid.Validated<T1, TError>>! first, System.Threading.Tasks.Task<DotValid.Validated<T2, TError>>! second, System.Func<T1, T2, TResult>! combine) -> System.Threading.Tasks.ValueTask<DotValid.Validated<TResult, TError>>
static DotValid.Validated.Errors<T, TError>(this System.Collections.Generic.IEnumerable<DotValid.Validated<T, TError>>! source) -> System.Collections.Generic.IEnumerable<TError>!
static DotValid.Validated.FromNullable<T, TError>(T? value, System.Func<TError>! error) -> DotValid.Validated<T!, TError>
static DotValid.Validated.FromNullable<T, TError>(T? value, System.Func<TError>! error) -> DotValid.Validated<T, TError>
static DotValid.Validated.FromNullable<T, TError>(T? value, TError error) -> DotValid.Validated<T!, TError>
static DotValid.Validated.FromNullable<T, TError>(T? value, TError error) -> DotValid.Validated<T, TError>
static DotValid.Validated.Partition<T, TError>(this System.Collections.Generic.IEnumerable<DotValid.Validated<T, TError>>! source) -> (System.Collections.Generic.IReadOnlyList<T>! Values, System.Collections.Generic.IReadOnlyList<TError>! Errors)
static DotValid.Validated.Sequence<T, TError>(this System.Collections.Generic.IEnumerable<DotValid.Validated<T, TError>>! source) -> DotValid.Validated<System.Collections.Generic.IReadOnlyList<T>!, TError>
static DotValid.Validated.Traverse<T, TResult, TError>(this System.Collections.Generic.IEnumerable<T>! source, System.Func<T, DotValid.Validated<TResult, TError>>! selector) -> DotValid.Validated<System.Collections.Generic.IReadOnlyList<TResult>!, TError>
static DotValid.Validated.Values<T, TError>(this System.Collections.Generic.IEnumerable<DotValid.Validated<T, TError>>! source) -> System.Collections.Generic.IEnumerable<T>!
static DotValid.Validated<T, TError>.operator !=(DotValid.Validated<T, TError> left, DotValid.Validated<T, TError> right) -> bool
static DotValid.Validated<T, TError>.operator ==(DotValid.Validated<T, TError> left, DotValid.Validated<T, TError> right) -> bool
static DotValid.ValidationError.operator !=(DotValid.ValidationError left, DotValid.ValidationError right) -> bool
static DotValid.ValidationError.operator ==(DotValid.ValidationError left, DotValid.ValidationError right) -> bool
~override DotValid.ValidationError.Equals(object obj) -> bool
Loading
Loading