Skip to content

API Annotations : add Locations in hsSyn where layout occurs

At the moment ghc-exactprint, which uses the GHC API Annotations to provide a framework for roundtripping Haskell source code with optional AST edits, has to implement a horrible workaround to manage the points where layout needs to be captured.

These are

  MatchGroup
  HsDo
  HsCmdDo
  HsLet
  LetStmt
  HsCmdLet
  GRHSs

To provide a more natural representation, the contents subject to layout rules need to be wrapped in a SrcSpan.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information