Skip to content

[#897] Add Constrained utility existential

Nikolay Yakimov requested to merge lierdakil/#897-constrained-gadt into master

NB: Some awkward instances could be simplified with GEq and GCompare, but that's left for #898 (closed).

Description

Problem: We use constrained existentials over GADTs in at least two places:

  • Morley.Tezos.Address.ConstrainedAddress
  • Morley.Michelson.Typed.Existential.SomeConstrainedValue

These two are very similar. Makes sense to unify them.

Solution: Introduce Constrained existential, similar to Some from some, but with additional constraints captured.

Related issue(s)

Resolves #897 (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