filter predicate xs
:) filter predicate xs
:)I always love the problems on SPOJ where they give you the number of cases up front, because in Haskell you can almost always throw out that value. Your map function knows when the list is out of elements.
CollectionUtils.filter(collection, predicate);
Of course aside from being a bit more verbose, predicate needs to be an object (often a singleton), because you can't pass around functions.var filteredCollection = collection.Where(x => predicate(x));
var filteredCollection = collection.Where(predicate);
I agree that C# is a fundamentally usable language.