FSharp.Collections.ParallelSeq


F# Parallel Sequences

This component provides F#-style API for parallel operations on sequences that are part of .NET 4.0 as System.Linq.ParallelEnumerable class. The API is akin to F# operations on sequences.

The F# FSharp.Collections.ParallelSeq library can be installed from NuGet:
PM> Install-Package FSharp.Collections.ParallelSeq

Example

This example demonstrates using a function defined in this sample library.

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
#r "FSharp.Collections.ParallelSeq.dll"
open FSharp.Collections.ParallelSeq

let nums = [|1..500000|]
let finalDigitOfPrimes = 
        nums 
        |> PSeq.filter isPrime
        |> PSeq.groupBy (fun i -> i % 10)
        |> PSeq.map (fun (k, vs) -> (k, Seq.length vs))
        |> PSeq.toArray  

Some more info

Samples & documentation

The library comes with comprehensible documentation. It can include a tutorials automatically generated from *.fsx files in the content folder. The API reference is automatically generated from Markdown comments in the library implementation.

  • Tutorial contains a further explanation of this sample library.

  • API Reference contains automatically generated documentation for all types, modules and functions in the library. This includes additional brief samples on using most of the functions.

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests. If you're adding new public API, please also consider adding samples that can be turned into a documentation. You might also want to read library design notes to understand how it works.

The library is available under the Apache 2.0 license, which allows modification and redistribution for both commercial and non-commercial purposes. For more information see the License file in the GitHub repository.

namespace FSharp
namespace FSharp.Collections
namespace FSharp.Collections.ParallelSeq
val nums : int []

Full name: Index.nums
val finalDigitOfPrimes : (int * int) array

Full name: Index.finalDigitOfPrimes
module PSeq

from FSharp.Collections.ParallelSeq
val filter : predicate:('T -> bool) -> source:seq<'T> -> pseq<'T>

Full name: FSharp.Collections.ParallelSeq.PSeq.filter
val groupBy : projection:('T -> 'Key) -> source:seq<'T> -> pseq<'Key * seq<'T>> (requires equality)

Full name: FSharp.Collections.ParallelSeq.PSeq.groupBy
val i : int
val map : mapping:('T -> 'U) -> source:seq<'T> -> pseq<'U>

Full name: FSharp.Collections.ParallelSeq.PSeq.map
val k : int
val vs : seq<int>
module Seq

from Microsoft.FSharp.Collections
val length : source:seq<'T> -> int

Full name: Microsoft.FSharp.Collections.Seq.length
val toArray : source:seq<'T> -> 'T array

Full name: FSharp.Collections.ParallelSeq.PSeq.toArray
F# Project
Fork me on GitHub