Skip to content

[#585] Weaken `Dupable` constraint for `getField`

Konstantin Ivanov requested to merge martoon/#585-smarter-use-of-dupable into master

Description

Currently getField requires the entire datatype to be Dupable (this was the simplest implementation, but also too restrictive for the real needs), this MR resolves this neatly so that only the obtained field itself has to be dupable.

The major issue here is that applying getField on a datatype consisting of dupable and non-dupable elements is easy to make inefficient, and I also try to make sure that the developer does not get unnecessarily expensive getField call accidentally.

Related issue(s)

Resolves #585 (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 Konstantin Ivanov

Merge request reports