Skip to content

[#898] Simplify some machinery using instances from `some`

Nikolay Yakimov requested to merge lierdakil/#898-use-constraints-extras into master

I was agonizing way too long about whether to switch to Some in Address and SomeAlias. I didn't arrive to a conclusion. Long story short, it's more efficient (as it's a newtype under the hood), and semantically seems more correct than Constrained with a truthy constraint. But it needs more instances, both derived and manual, and working with it requires importing a bit of stuff from some, i.e. downstream packages have to add some to their dependencies.

Description

Problem: we can make use of the same machinery used by some, like GEq, GCompare, ArgDict, to get rid of some awkward boilerplate.

Solution: Do that.

Related issue(s)

Resolves #898 (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)

Merge request reports