FSharp.Interop.Compose


FSharp.Interop.Compose Extensions

inlined composable fsharp functions around BCL static methods. Supports .net 3.5 through .net Standard

Examples

FSharp.Interop.Compose.Linq.Enumerable

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
open FSharp.Interop.Compose.Linq

seq { 1 .. 5 } |> Enumerable.reverse // seq [5; 4; 3; 2; ...]

Seq.empty<int> |> Enumerable.defaultIfEmpty // seq [0]

[("Rust", "Cohle"); ("Marty", "Hart"); ("Maggie", "Hart")]
    |> Enumerable.orderBy snd
    |> Enumerable.thenBy fst
  //seq [("Rust", "Cohle"); ("Maggie", "Hart"); ("Marty", "Hart")]

FSharp.Interop.Compose.System.String

1: 
2: 
3: 
4: 
open FSharp.Interop.Compose.System

["One";"Two";"Three"]
   |> Seq.filter (String.startsWith "T") // seq ["Two";"Three"]

API

See api-docs for wrapper functions

Use

To use precompiled dll, add with nuget

1: 
PM> Install-Package FSharp.Interop.Compose

Contribute

The generate target of the F# make file Make.fsx provides a mechansim to identify static base class libraries and alter their parameter order and write out the module on a per class basis.

The tool/Generate.fsx script provides the generalized api for generating those wrappers.

Note: inline non-mutating instance method

FSUnit xUnit tests can be added in .fsx files in the test directory.

Build

To build on Mono Build Status

1: 
./build.fsx

or on Windows Build status

1: 
fsi --exec build.fsx
Fork me on GitHub