Funtom.Linq 0.0.6

There is a newer version of this package available.
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
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="Funtom.Linq" Version="0.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Funtom.Linq --version 0.0.6
#r "nuget: Funtom.Linq, 0.0.6"
#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 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

img

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.

  1. When using System.Linq

    open System.Linq
    
    let xs =
      [ 0..10 ]
        .Where ((>) 5)
        .Select ((*) 2)
    
  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:
image

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.

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
0.0.8 462 3/21/2022
0.0.7 427 3/4/2022
0.0.6 445 2/5/2022
0.0.5 290 1/4/2022
0.0.4 254 1/3/2022
0.0.3 419 12/31/2021
0.0.2 284 12/12/2021
0.0.1 461 12/11/2021