Pure.Primitives.Switches 1.2.0

dotnet add package Pure.Primitives.Switches --version 1.2.0
                    
NuGet\Install-Package Pure.Primitives.Switches -Version 1.2.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.Switches" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.Primitives.Switches" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Pure.Primitives.Switches" />
                    
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.Switches --version 1.2.0
                    
#r "nuget: Pure.Primitives.Switches, 1.2.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.Switches@1.2.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.Switches&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Pure.Primitives.Switches&version=1.2.0
                    
Install as a Cake Tool

Pure.Primitives.Switches

Switch-based conditional primitives for the Pure ecosystem — evaluate one of N branches based on a discriminant value.

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

Overview

Pure.Primitives.Switches provides a *Switch type for every primitive in the Pure ecosystem. Each switch type holds a discriminant value and a collection of (predicate, result) branches, evaluating the first branch whose predicate matches and returning the associated result.

Types

Type Implements Discriminant
BoolSwitch IBool IBool
CharSwitch IChar IChar
StringSwitch IString IString
NumberSwitch<T> INumber<T> INumber<T>
GuidSwitch IGuid IGuid
DateSwitch IDate IDate
TimeSwitch ITime ITime
DateTimeSwitch IDateTime IDateTime
DayOfWeekSwitch IDayOfWeek IDayOfWeek

Design Principles

  • Lazy evaluation — branches are evaluated only when the value property is accessed.
  • Composable — switch results are Pure primitives and can be nested inside other operations.
  • 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.Switches:

Package Downloads
Pure.RelationalSchema.Self.Storage.Introjection

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.2.0 4 10/22/2026
1.1.3 1,110 6/25/2026
1.1.2 811 5/20/2026
1.1.1 182 5/7/2026
1.1.0 1,691 12/10/2025
1.0.0 942 11/1/2025
0.1.0 774 9/2/2025