KrisJordan/f_underscore — pull request #4 by johnomalley (2012-10-20 19:10:59+00:00)
Title: Predicate version of _.where plus f_.identity

I just discovered this library and it's almost exactly what I'm looking for. The API is nice and intuitive.

I've added a few features for your consideration:

f_.identity - I find myself creating predicates using _.bind(_.identity, null, true) (for example). This is kind of awkward. Sometimes you want to create a predicate that always returns a particular value (then you can change that behavior dynamically of course).

f_.where - _.where is a nice addition in the latest underscore but it filters in lieu of creating a predicate. f_.where seems like the natural companion... essentially _.where(items, {active:true}) and _.filter(items, f_.where({active: true})) would be equivalent. The predicate version would be useful for _.any(). I realize that it's possible to accomplish this with f_.and, f_.get, etc. but I think the f_.where syntax would be preferable.