Funtom.Linq
0.0.6
See the version list below for details.
dotnet add package Funtom.Linq --version 0.0.6
NuGet\Install-Package Funtom.Linq -Version 0.0.6
<PackageReference Include="Funtom.Linq" Version="0.0.6" />
paket add Funtom.Linq --version 0.0.6
#r "nuget: Funtom.Linq, 0.0.6"
// Install Funtom.Linq as a Cake Addin #addin nuget:?package=Funtom.Linq&version=0.0.6 // Install Funtom.Linq as a Cake Tool #tool nuget:?package=Funtom.Linq&version=0.0.6
Funtom.Linq
Funtom.Linq is a library for F# that is compatible with System.Linq.
This library makes it easier to use pipeline operators and optimizes for FSharp.Core.List<'T> and more.
Naming rules
The method names defined in System.Linq are redefined in camelCase.
For example, 'Select' becomes 'select', 'ToList' becomes 'toList' and so on.
Usage
In this section, I will show you how to use the System.Linq 'Where' and 'Select' method as an example.
When using System.Linq
open System.Linq let xs = [ 0..10 ] .Where ((>) 5) .Select ((*) 2)
When using Funtom.Linq
#r "nuget: Funtom.Linq" open Funtom.Linq let xs = [ 0..10 ] |> Linq.where ((>) 5) |> Linq.select ((*) 2)
Performance
Funtom.Linq is intended to be implemented in such a way that its performance is almost equal to or better than that of System.Linq.
Let's compare the performance of 'Select'.
let xs = [ 0 .. 10000 ]
let ys = [| 0 .. 10000 |]
let zs = ResizeArray([| 0 .. 10000 |])
let ss = seq { 0 .. 10000 }
[<Benchmark>]
member __.Fsharp_Seq_map_fslist() = xs |> Seq.map ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Funtom_select_fslist() = xs |> Linq.select ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Linq_Select_fslist() = xs.Select((*) 2).ToArray()
[<Benchmark>]
member __.Fsharp_Seq_map_array() = ys |> Seq.map ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Funtom_select_array() = ys |> Linq.select ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Linq_Select_array() = ys.Select((*) 2).ToArray()
[<Benchmark>]
member __.Fsharp_Seq_map_resizearry() = zs |> Seq.map ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Funtom_select_resizearry() = zs |> Linq.select ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Linq_Select_resizearry() = zs.Select((*) 2).ToArray()
[<Benchmark>]
member __.Fsharp_Seq_map_seq() = ss |> Seq.map ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Funtom_select_seq() = ss |> Linq.select ((*) 2) |> Linq.toArray
[<Benchmark>]
member __.Linq_Select_seq() = ss.Select((*) 2).ToArray()
Result:
Product | Versions 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. |
-
net6.0
- FSharp.Core (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.