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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pure.Primitives.Choices" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.Primitives.Choices" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Pure.Primitives.Choices" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pure.Primitives.Choices --version 1.3.0
                    
#r "nuget: Pure.Primitives.Choices, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Pure.Primitives.Choices@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pure.Primitives.Choices&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Pure.Primitives.Choices&version=1.3.0
                    
Install as a Cake Tool

Pure.Primitives.Choices

Conditional selection types for Pure primitives — select between two values based on an IBool condition.

.NET build & test Build and Deploy NuGet License: MIT

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 IBool expression and any compatible Pure primitive can be nested inside a choice.
  • AOT-compatible — no reflection; fully compatible with Native AOT.

Dependencies

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.3.0 534 10/22/2026
1.2.2 1,744 5/20/2026
1.2.1 159 5/7/2026
1.2.0 1,587 12/10/2025
1.1.0 930 11/1/2025
1.0.0 185 11/1/2025
0.3.0 778 5/28/2025
0.2.0 242 5/26/2025
0.1.0 213 5/23/2025