Saturday, January 02, 2010 8:33 AM
LINQSQO v4.0 and MinLINQ v1.0 Now Available for Download
Introduced in my previous blog post on The Essence of LINQ – MinLINQ, the first release of this project is now available for reference at the LINQSQO CodePlex website at http://linqsqo.codeplex.com. Compared to the write-up over here in my previous post, there are a few small differences and caveats:
- Only FEnumerable functionality is available currently; the FObservable dual may follow later.
- Option<T> has been renamed to Maybe<T>, to be CLS compliant and avoid clashes with the VB keyword.
- Some operators are not provided, in particular GroupBy, GroupJoin and Join. They’re left as an exercise.
- A few operator implementations are categorized as “cheaters” since they roundtrip through System.Linq.
- Don’t nag about performance. The MinLINQ code base is by no means optimal and so be it.
- Very few System.Interactive operators are included since those often require extra foundations (such as concurrency).
A few highlights:
- FEnumerable.Essentials.cs is where the fun starts. Here the three primitives – Ana, Bind and Cata – form the ABC of LINQ.
- There’s a Naturals() constructor function generating an infinite sequence of natural numbers, used in operators that use indexes.
- OrderBy and ThenBy are supported through roundtripping to System.Linq with a handy trick to keep track of IOrderedEnumerable<T>.
- As a sample, I’ve included Luke Hoban’s LINQified RayTracer with AsFEnumerable and AsEnumerable roundtripping. It works just fine.
- Creating an architectural diagram in Visual Studio 2010 yields the following result (not meant to zoomed in), where I’ve used the following colors:
- Green = Ana
- Blue = Bind
- Red = Cata
Obviously, all sorts of warnings apply. People familiar to my blog adventures will know this already, but just in case:
// This project is meant as an illustration of how an academically satifying layering
// of a LINQ to Objects implementation can be realized using monadic concepts and only
// three primitives: anamorphism, bind and catamorphism.
// The code in this project is not meant to be used in production and no guarantees are
// made about its functionality. Use it for academic stimulation purposes only. To use
// LINQ for real, use System.Linq in .NET 3.5 or higher.
// All of the source code may be used in presentations of LINQ or for other educational
// purposes, but references to http://www.codeplex.com/LINQSQO and the blog post referred
// to above - "The Essence of LINQ - MinLINQ" - are required.
Either way, if you find LINQ interesting and can stand some “brain pain of the highest quality” (a Twitter quote by dahlbyk), this will likely be something for you.Del.icio.us
| Digg It
Filed under: LINQ, Crazy Sundays