milessabin/shapeless — pull request #95 by ceedubs (2014-05-10 14:56:03+00:00)
Title: Support selectDynamic access to records

Adds a `dynamic` method to `RecordOps` that returns a wrapped version of
the record that provides `selectDynamic` access to fields whose keys are
strings.

I'm not particularly attached to the way this is set up.
* Declaring an `Ops` class as the return type for a method that isn't an implicit conversion feels wrong. I do think that `selectDynamic` access should be opt-in and not automatically attached to records, though.
* While this uses `selectDynamic`, this is all statically verified at compile-time, so `dynamic` might not be the best name.
* Due to my anal retentive nature, the special case of `l` returning the underlying `HList` as opposed to falling through to `selectDynamic` bothers me a bit. It seems like there should be some way of getting back to the underlying record though.

It was a simple and small enough change that it seemed best to just throw together a pull request for discussion.