andrewdavey/immutable-object — pull request #3 by sbrekken (2014-04-09 09:22:51+00:00)
Title: Add arrayWhere method to lens.

This adds `lens.arrayWhere` which makes it simple to create lenses that target array items by propery value.

```javascript
var data = immutable([
{id: "a", name: "Foo"},
{id: "b", name: "Bar"}
])

var aLens = lens.arrayWhere("id", "a")
console.log(aLens.get(data).name)

var aNameLens = lens.compose(aLens, lens.prop("name"))
var newData = aNameLens.set(data, "Faz")

console.log(aLens.get(newData).name)
```

There's definitely room for improvement as far as the implementation goes, I chose to go for speed rather than implementing the loops with `Array.some`.

In addition it might be interesting to implement a check for the first parameter, if it's a function use it to locate the correct array element.