[Haskell-Cafe] Linq (FP in C#)
hughperkins at gmail.com
Sat Jan 12 08:46:11 EST 2008
Linq went live in C# in November, as part of .Net 3.5.
It adds lots of FP-things to C#.
It's really fun to be able to use Haskell-ish things in C#.
Manipulating lists and collections just got *much* easier.
Things it does:
- map, fold, filter are all there (they're called "select", "agregate", "where")
- limited support for laziness (since .Net 2.0; you can write a lazy
"zip" function; I couldnt figure out how to write a lazy "unzip"
- you can extend the methods available on all lists and collections
- lambda expressions
- type inferrence (technically, this is part of .Net 3.x, rather than
specific to Linq).
Things it doesnt do:
- recursion doesnt seem particularly optimized (quick 2 minute test, I
could be wrong)
- no way to enforce purity
It's an interesting vindication of the ideas in Haskell that C#, a big
mainstream language, has integrated ideas from it, and that they're in
More information about the Haskell-Cafe