Skip to content

jbtule/FSharp.Interop.Compose

Repository files navigation

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

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

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

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

./build.fsx

or on Windows Build status

fsi --exec build.fsx

About

Automated composable inline F# functions for .net BCL static methods.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages