• Ömer Sinan Ağacan's avatar
    Refactor GHCi UI to fix #11606, #12091, #15721, #16096 · a34ee615
    Ömer Sinan Ağacan authored
    Instead of parsing and executing a statement or declaration directly we
    now parse them first and then execute in a separate step. This gives us
    the flexibility to inspect the parsed declaration before execution.
    Using this we now inspect parsed declarations, and if it's a single
    declaration of form `x = y` we execute it as `let x = y` instead, fixing
    a ton of problems caused by poor declaration support in GHCi.
    To avoid any users of the modules I left `execStmt` and `runDecls`
    unchanged and added `execStmt'` and `runDecls'` which work on parsed
UI.hs 154 KB