Skip to content

[#359] Turn `unpair` into standalone instruction

Diogo Castro requested to merge diogo/#359-unpair into master

Description

NOTE: at the moment, this MR is based on top of !825 (merged)

  • Added new UNPAIR instruction
  • Renamed the UNPAIR macro to UNPAPAIR
  • Updated macro expansion: expand UNPAPAIR macros to UNPAIR instructions.

Added optimizer rules:

  • Optimize DUP; CAR; DIP { CDR } to UNPAIR
  • Optimize DUP; CDR; DIP { CAR } to UNPAIR; SWAP

Also added a quality-of-life-improvement, to make it easier to write optimizer rules:

  • The Seq constructor can now be used as a right-associative operator.

Related issue(s)

Resolves #359 (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 Diogo Castro

Merge request reports