Skip to content

[#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

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog files of all affected packages released to Hackage if my changes are externally visible.

Stylistic guide (mandatory)

Edited by Nikolay Yakimov

Merge request reports