libanvl.opt 1.5.8-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 1.5.8-beta
NuGet\Install-Package libanvl.opt -Version 1.5.8-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="1.5.8-beta" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add libanvl.opt --version 1.5.8-beta
#r "nuget: libanvl.opt, 1.5.8-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.
// Install libanvl.opt as a Cake Addin
#addin nuget:?package=libanvl.opt&version=1.5.8-beta&prerelease

// Install libanvl.opt as a Cake Tool
#tool nuget:?package=libanvl.opt&version=1.5.8-beta&prerelease

libanvl.dotnet

Some dotnet utilities

.NET 6 CodeQL Nuget (with prereleases)

libanvl.Opt

A null-free optional value library for #nullabe enable contexts

class Car
{
	public string Driver { get; set;}
}

public void AcceptOptionalValue(Opt<Car> optCar, Opt<string> optName)
{
	if (optCar is Opt<Car>.Some someCar)
	{
		someCar.Value.Driver = optName.SomeOrDefault("Default Driver");
	}

	if (optCar.IsNone)
	{
		throw new Exception();
	}

	// or use Unwrap() to throw for None

	Car bcar = optCar.Unwrap();
}

public void RunCarOperations()
{
	var acar = new Car();
	AcceptOptionalValue(acar, "Rick");

	Car? nocar = null;
	AcceptOptionalValue(nocar.WrapOpt(), None.String)

	// use Select to project to an Opt of an inner property
	Opt<string> driver = acar.Select(x => x.Driver);
}

public void OptsOfEnumerablesAreIterable<T>(Opt<List<T>> optList)
{
	// if optList is None, the enumerable is empty, not null
	foreach (T item in optList)
	{
		Console.WriteLine(item);
	}

	// this is equivalent
	foreach (T item in optList.SomeOrEmpty())
	{
		Console.WriteLine(item);
	}
}
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

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

Package Downloads
Tapanga.Plugin

Plugin API for the Tapanga terminal profile generator framework

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.10.3-beta 290 11/13/2021
1.10.2-beta 139 11/13/2021
1.9.7-beta 134 11/12/2021
1.6.8-beta 184 11/7/2021
1.5.10-beta 209 11/4/2021
1.5.9-beta 137 11/4/2021
1.5.8-beta 157 11/4/2021
1.4.13-beta 153 11/2/2021