[#648] Add dot operator support for Lorentz storage fields
Description
Add support for OverloadedRecordDot
to StoreClass
; deprecate StoreClass.Extra
.
There's a small kink: since Lorentz is intended to work with RebindableSyntax
, OverloadedRecordDot
doesn't use GHC's HasField
, but instead whatever getField
is in scope. Lorentz provides its own getField
, and its type isn't right, which will lead to confusing error messages like this:
• Expected a type, but
‘"gField"’ has kind
‘ghc-prim-0.9.0:GHC.Types.Symbol’
The workaround is to hide Lorentz's getField
and import GHC's from GHC.Records
. This is suboptimal, to say the least, but I couldn't think of any alternatives, save for renaming Lorentz's getField
.
Related issue(s)
Resolves #648 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Nikolay Yakimov