Ban use of RecordWildCards
in favor of OverloadedRecordDot
#640
Labels
enhancement
New feature or request
RecordWildCards
in favor of OverloadedRecordDot
#640
We've collected quite a few cases where we follow a pattern like this:
While nice while writing the code (because the author is keenly aware of the fields in the various records), it makes it really hard to read the code. Specifically, it is difficult to trace the provenance of variables. Of course, in this very small example it's not that bad, but the problems are exacerbated when code becomes more spread out -- as it naturally tends to do.
With the introduction of
OverloadedRecordDot
(GHC 9.2) we can write the following instead:Note that we sometimes also do:
This is suffers from similar issues, though it doesn't have "great" solution except for just writing the names out with
NamedFieldPuns
:The text was updated successfully, but these errors were encountered: