Pure.Primitives.Choices
1.3.0
dotnet add package Pure.Primitives.Choices --version 1.3.0
NuGet\Install-Package Pure.Primitives.Choices -Version 1.3.0
<PackageReference Include="Pure.Primitives.Choices" Version="1.3.0" />
<PackageVersion Include="Pure.Primitives.Choices" Version="1.3.0" />
<PackageReference Include="Pure.Primitives.Choices" />
paket add Pure.Primitives.Choices --version 1.3.0
#r "nuget: Pure.Primitives.Choices, 1.3.0"
#:package Pure.Primitives.Choices@1.3.0
#addin nuget:?package=Pure.Primitives.Choices&version=1.3.0
#tool nuget:?package=Pure.Primitives.Choices&version=1.3.0
Pure.Primitives.Choices
Conditional selection types for Pure primitives — select between two values based on an IBool condition.
Overview
Pure.Primitives.Choices provides a *Choice type for every primitive in the Pure ecosystem. Each choice type wraps an IBool condition and two candidate values — WhenTrue and WhenFalse — and resolves to one of them lazily when the underlying value property is accessed.
Types
| Type | Implements | Selects between |
|---|---|---|
BoolChoice |
IBool |
Two IBool values |
CharChoice |
IChar |
Two IChar values |
StringChoice |
IString |
Two IString values |
NumberChoice<T> |
INumber<T> |
Two INumber<T> values |
GuidChoice |
IGuid |
Two IGuid values |
DateChoice |
IDate |
Two IDate values |
TimeChoice |
ITime |
Two ITime values |
DateTimeChoice |
IDateTime |
Two IDateTime values |
DayOfWeekChoice |
IDayOfWeek |
Two IDayOfWeek values |
All types are sealed records and accept (IBool condition, T whenTrue, T whenFalse).
Design Principles
- Lazy evaluation — the condition is evaluated only when the value property is accessed.
- Composable — any
IBoolexpression and any compatible Pure primitive can be nested inside a choice. - AOT-compatible — no reflection; fully compatible with Native AOT.
Dependencies
Pure.Primitives.Abstractions— Pure primitive interfaces
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Pure.Primitives (>= 3.7.0)
-
net7.0
- Pure.Primitives (>= 3.7.0)
-
net8.0
- Pure.Primitives (>= 3.7.0)
-
net9.0
- Pure.Primitives (>= 3.7.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pure.Primitives.Choices:
| Package | Downloads |
|---|---|
|
Pure.RelationalSchema.Storage.PostgreSQL.Querying
Package Description |
|
|
Pure.RelationalSchema.Storage.PostgreSQL.Creation
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.