google / google/haskell-indexer
Special-case lenses from makeLenses to link to field definition
- Dominant language
- Haskell
- Stars
- 103
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
We had the following suggestion: currently, if you click on a lens generated by `makeLenses`, it goes to the original TemplateHaskell call `$(makeLenses ...)` (from `Control.Lens.TH`). That's technically correct, since that's where the lens is defined, but almost always what you really want is the original record field definition instead. For example, in
```
data Foo = Foo { _bar :: Int }
$(makeLenses ''Foo)
...
... = ... bar ...
```
Clicking on `bar` in the last line should go to the original definition of `_bar`, rather than the call to `makeLenses`. The latter might not be close by the field, or it might be less convenient when there are many fields of a given record.
Contributor guide
Assessment
This issue has not been assessed yet.