Transferring over this issue as posted by bos ekmett/lens#423
At the moment, combinators like key are polymorphic over some types, but not all. For instance, I can use key on either a ByteString or a Value.
The http-client library defines a Response type, such that I can have a Response ByteString or a Response Value. I cannot currently figure out how to swizzle the various moving parts such that I can use key and other combinators on one of these.
(Of course I have a responseBody lens, so I can write responseBody . key "foo", but my wish is to be able to more simply write key "foo" instead.)
Transferring over this issue as posted by bos ekmett/lens#423
At the moment, combinators like key are polymorphic over some types, but not all. For instance, I can use key on either a ByteString or a Value.
The http-client library defines a Response type, such that I can have a Response ByteString or a Response Value. I cannot currently figure out how to swizzle the various moving parts such that I can use key and other combinators on one of these.
(Of course I have a responseBody lens, so I can write responseBody . key "foo", but my wish is to be able to more simply write key "foo" instead.)