Skip to content

[#756] Add monadic `dfsInstr`

Konstantin Ivanov requested to merge martoon/#756-monadic-dfs-instr into master

Description

In debugger we need an advanced dfs traversal of instructions. This MR changes our dfsInstr to support that.

The point is to make dfsInstr monadic. With such an interface, we get more flexibility in one place, e.g. our use case - enumerating instructions, is now easy to handle with State monad. But we slightly lose flexibility in other: CtorEffectsApp got less powerful. Anyway, we never needed it being that flexible.

Additionally I do some other minor additions that were found useful in the debugger project.

Related issue(s)

Resolves #756 (closed)

Checklist for your Merge Request

Related changes (conditional)

  • Tests (see short guidelines)

    • If I added new functionality, I added tests covering it. This is merely a refactoring.
    • 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 Konstantin Ivanov

Merge request reports