Hi,
I am upgrading Gogol 0.5 to master (1.0.0) and noticed that field lenses are dropped (such us tfsName), but new approach is not clear.
Disappeared lens
tfsName :: Lens' TableFieldSchema (Maybe Text)
-- /See:/ 'newTableFieldSchema' smart constructor.
data TableFieldSchema = TableFieldSchema
{
name :: (Core.Maybe Core.Text),
opened 08:30AM - 15 Aug 22 UTC
Hi, this is likely a trivial question, but i've been banging my head on this for… a bit too long.
How do I access the fields in a Pubsub RecievedMessage record?
I had this line of code before the updates:
```
let rmMsg = msg ^? rmMessage . _Just . psData . _Just
```
But this doesn't work anymore.
So i saw tried what I saw from the generic-lens package and from diving into gogol-pubsub codebase:
```
let rmMsg = msg ^? #message . _Just . #data . _Just
```
Which gives the error:
```
• No instance for (IsLabel
"message"
(p0 (Maybe a0) (f0 (Maybe b0))
-> ReceivedMessage -> Const (First ByteString) ReceivedMessage))
arising from the overloaded label ‘#message’
(maybe you haven't applied a function to enough arguments?)
• In the first argument of ‘(.)’, namely ‘#message’
In the second argument of ‘(^?)’, namely
‘#message . _Just . #data . _Just’
In the expression: msg ^? #message . _Just . #data . _Just
|
102 | let rmMsg = msg ^? #message . _Just . #data . _Just
| ^^^^^^^^
```
Is it that the lenses are not derived on the fields?
Next, I tried to fall back on regular haskell
```
let rmMsg = fromMaybe "" $ maybe (Nothing) (data') (message msg)
```
But then I get an error about the NoFieldSelectors extension. So it seems the fieldselectors are not exposed, so I can't query using them either.
```
• Variable not in scope: data' :: a0 -> Maybe (Maybe ByteString)
• Perhaps you want to add ‘data'’ to the import list
in the import of ‘Gogol.PubSub.Types’
(src/ProcessMessage.hs:12:1-74).
NB: ‘data'’ is a field selector belonging to the type ‘PubsubMessage’
that has been suppressed by NoFieldSelectors
|
104 | let rmMsg = fromMaybe "" $ maybe (Nothing) (data') (message msg)
| ^^^^^
```