Skip to content

[#470] Add `GET n` instruction

Diogo Castro requested to merge diogo/#470-get-n into master

Description

This MR introduces the new GET n instruction.

GET ix gets the node at index ix of a right-combed pair.

Nodes are 0-indexed, and are numbered in a breadth-first, left-to-right fashion.

For example, a pair with 3 elements @pair a b c@ will be represented as a tree with 5 nodes:

   pair
   /   \
 a     pair
       /   \
     b       c

Where the nodes are numbered as follows:

     0
   /   \
 1       2
       /   \
     3       4

Related issue(s)

Resolves part of #470 (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