google / google/haskell-indexer

Special-case lenses from makeLenses to link to field definition

Open
#134 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.