Linq.Expressions.Deconstruct 1.0.8.1

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

// Install Linq.Expressions.Deconstruct as a Cake Tool
#tool nuget:?package=Linq.Expressions.Deconstruct&version=1.0.8.1                

Linq.Expressions.Deconstruct

Build status NuGet Version and Downloads count

[Test]
public void MatchTest()
{
    Expression<Func<int,int>> f = i => i * 2;

    switch (f.ToExpr())
    {
        case Lambda(Multiply(Parameter("i") p1, Constant(2)), [("i") p2])
            when p1 == p2 :
            Console.WriteLine("Pattern Matched!");
            break;
        default:
            Console.WriteLine(f);
            Assert.Fail();
            break;
    }
}
[Test]
public void ConstantFoldingTest()
{
    Expression<Func<int,int>> f = i => i * 0 + 0 + i + 10 * (i * 0 + 2);

    var f1 = f.TransformEx(ex => ex switch
    {
        Multiply(Constant(0) e,   _)               => e,               // 0 * e => 0
        Multiply(_,               Constant(0) e)   => e,               // e * 0 => 0
        Multiply(Constant(1),     var e)           => e,               // 1 * e => e
        Multiply(var e,           Constant(1))     => e,               // e * 1 => e
        Divide  (Constant(0) e,   _)               => e,               // 0 / e => 0
        Divide  (var e,           Constant(1))     => e,               // e / 1 => e
        Add     (Constant(0),     var e)           => e,               // 0 + e => e
        Add     (var e,           Constant(0))     => e,               // e + 0 => e
        Subtract(Constant(0),     var e)           => Negate(e),       // 0 - e => -e
        Subtract(var e,           Constant(0))     => e,               // e - 0 => e
        Multiply(Constant(int x), Constant(int y)) => Constant(x * y), // x * y => e
        Divide  (Constant(int x), Constant(int y)) => Constant(x / y), // x / y => e
        Add     (Constant(int x), Constant(int y)) => Constant(x + y), // x + y => e
        Subtract(Constant(int x), Constant(int y)) => Constant(x - y), // x - y => e
        _                                          => ex
    });

    Assert.IsTrue(f1.EqualsTo(i => i + 20));
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.8.1 119 4/16/2024
1.0.7 618 12/7/2022
1.0.6 549 12/21/2020
1.0.5 463 11/26/2020
1.0.4 728 8/5/2019
1.0.3 557 8/5/2019
1.0.2 585 8/4/2019
1.0.1 559 8/2/2019
1.0.0 577 8/1/2019