A couple of months ago I started writing FSharp.Core.CS, a project to bridge F# core constructs to C#, such as the Option type. I think I never mentioned it explicitly but I did blog about it, for example back when I wrote about validating with applicative functors with LINQ.
I realized I was going to implement several monads in F# and there was an excellent project already doing that: Ryan Riley's FSharp.Monad. It only missed C# compatibility, exactly what I was doing in FSharp.Core.CS among other things, and FSharp.Monad already was doing some things other than monads, so it seemed like the perfect moment to merge both projects, and so we created FSharpx.
FSharpx aims to create a wider and richer foundation for programming in .NET, building on top of the F# core library and the PowerPack. It targets mainly F# but strives to be usable from all .NET languages wherever possible.
It's similar in spirit to Scalaz, even though Scala can do things like typeclasses which F#/C# cannot.
Here's a brief summary of what FSharpx.Core currently implements:
- Monads: Maybe (also available in LINQ), State, Reader, Writer, Either (also in LINQ), Continuation, Distribution, Undo
- Monoids: int sum, int product, option wrapper
- ZipList
- Nullable operators
- Iteratee
- Validation as applicative functor (also in LINQ), parametrizable by monoid
- Collections extensions
- Option extensions
- Helpers to make functional programming in C# easier
- LINQ bindings to use F# async (similar to this)
- Helpers to make C# - F# interop easier
- General basic functions from the Haskell prelude, such as flip, curry, tuple constructors...
Tomas Petricek's async extensions were also merged, under the name FSharpx.AsyncExtensions, which implements:
- Async sequences
- Reusable agents
- Observable extensions
Finally, Steffen Forkmann has started a branch for F# 3.0 type providers, which includes AppSettings, File system, Regex, CSV. These are implemented using a DSL on top of the base classes provided by Microsoft.
It's still early days for FSharpx, we're frequently breaking things, and there's almost no documentation. Still, I'm already using it in some of my projects (Figment, FsFormlets, CsFormlets) and in real-world production C#/VB.NET code.
I'm very excited about FSharpx as it is truly community-driven with many people involved. Contributors so far include Ryan Riley, Steffen Forkmann, Tomas Petricek, Daniel Mohl, Gustavo Guerra, Hodza Nassredin and yours truly.
So come check it out! If you have any questions, drop by our mailing list.
Woot! Can't wait to play with the new tools you made, thanks!
ReplyDelete