The first step in the ExpPatFrame refactoring: https://ghc.haskell.org/trac/ghc/wiki/Design/ExpPatFrame
- Create a new intermediate type, ExpPatFrame.
- Change Parser.y to produce ExpPatFrame for expressions.
- Write checkExpr of type LExpPatFrame -> LHsExpr GhcPs.
- Modify checkPattern to have type LExpPatFrame -> P (LHsPat GhcPs).
- Modify checkCommand to have type LExpPatFrame -> P (LHsCmd GhcPs).
The next step is to change checkExpr to work in the P monad and validate expressions there.