Skip to content

[#762] Use clearer notation for (-$)

Description

Problem: We're using '(-$)' quite a bit in the documentation (examples and doctests), however I find the pair notation somewhat confusing, especially when we're talking about instructions working on pairs themselves.

Solution: Introduce new data types 'ZippedStackRepr a b = a ::: b' and 'ZSNil = ZSNil', isomorphic to '(a, b)' and '()' respectively. 'infixr 5 :::'. Require their use to represent a zipped stack. This doesn't change the underlying Michelson representation, but disambiguates pairs and units from zipped stack representation.

See the diff for examples.

Related issue(s)

Resolves #762 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it. (kind of)
    • 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