Well, the library did one thing correctly using a class like Pretty. Then the task arises of choosing a different instance for the designers that you want to print in different ways. Ideally, you would just update the AST node you care about, and somehow replace this with AST.
Now the problem is that the Haskell AST exported by the library has a fixed type structure. This does not mean, for example, use two-level types that will allow you to replace newtypes for parts of the tree. Thus, you will need to override the AST type to the node you want to change.
source
share