Skip to content

[#144] Optimize some specific PUSHes, improve other rules

Ivan Gromakovskii requested to merge gromak/#144-optimizer into master

Description

Problem: some specific constants can be pushed more efficiently than using PUSH. E. g. empty map.

Solution: add corresponding rules to the optimizer (for unit, empty map and empty set).

Also this MR improves some existing rules.

It turned out to be hard to remove SWAP in front of commutative operations, it will be done later.

Related issue(s)

Resolves part of #144 (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 Ivan Gromakovskii

Merge request reports