libanvl.opt 2.7.6-beta

This is a prerelease version of libanvl.opt.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package libanvl.opt --version 2.7.6-beta
                    
NuGet\Install-Package libanvl.opt -Version 2.7.6-beta
                    
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="libanvl.opt" Version="2.7.6-beta" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="libanvl.opt" Version="2.7.6-beta" />
                    
Directory.Packages.props
<PackageReference Include="libanvl.opt" />
                    
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 libanvl.opt --version 2.7.6-beta
                    
#r "nuget: libanvl.opt, 2.7.6-beta"
                    
#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 libanvl.opt@2.7.6-beta
                    
#: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=libanvl.opt&version=2.7.6-beta&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=libanvl.opt&version=2.7.6-beta&prerelease
                    
Install as a Cake Tool

CI CodeQL Nuget (with prereleases) codecov

libanvl.Opt

A null-free optional value library for .NET with an emphasis on minimizing additional allocations.

  • An optional value is represented as the struct Opt<T>
  • A possible value or error is represented as the struct Result<T, E>
  • A zero to N values are represented as the struct Any<T>

See the Examples Tests for more on how to use Opt.

Requirements

.NET 8

Releases

  • NuGet packages are available on NuGet.org
    • Embedded debug symbols
    • Source Link enabled
  • NuGet packages from CI builds are available on the libanvl GitHub feed

libanvl.Opt Features

  • Immutable
  • Use Opt<T> instead of T? for optional values
  • Implicit conversion from T to Opt<T>
  • Deep selection of properties in complex objects
  • SomeOrDefault() for any type
  • Explicitly opt-in to exceptions with Unwrap()
  • Cast inner value to compatible type with Cast<U>()
  • Opts of IEnumerable<T> are iterable

libanvl.Result Features

  • Create success results with Result.Ok
  • Create error results with Result.Err
  • Unwrap values with Unwrap, throwing if the result is an error
  • Match on success or error with Match
  • Convert between Opt and Result

libanvl.OneOrMany Features

  • OneOrMany<T> for a single value or a collection of values
  • Implicit conversions
  • Equality operators

libanvl.Any Features

  • Any<T> for a single value or multiple values
  • Implicit conversions
  • Equality operators
  • Add and remove elements
  • Convert to array, list, or enumerable
  • Convert to Opt<T>
  • Cast elements to a compatible type

libanvl.AnyMap Features

  • Dictionary-like collection that maps keys to values of type Any<V>
  • Implements IAnyRefMap<K, V> for reference-based operations
  • Get or add value by reference with GetOrAddValueRef
  • Get value by reference with GetValueRef
  • Try to get value by reference with TryGetValueRef
  • Perform actions on each reference with ForEachRef
  • Enumerate references with GetEnumerator
Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on libanvl.opt:

Package Downloads
Tapanga.Plugin

Plugin API for the Tapanga terminal profile generator framework

SharpSchema

Core library for the SharpSchema project.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.7.7-beta 791 1/3/2025
2.7.6-beta 101 1/3/2025
2.7.5-beta 93 1/1/2025
2.6.11-beta 73 12/28/2024
2.5.4-rc 79 12/19/2024
2.4.4-rc 77 12/19/2024
2.3.7-rc 80 12/16/2024
2.2.14-rc 87 12/7/2024
2.1.9-rc 87 12/7/2024