Skip to content

EPA: Introduce [DeclTag] in AnnSortKey

Alan Zimmerman requested to merge wip/az/epa-decltag-in-sortkey into master

The AnnSortKey is used to keep track of the order of declarations for printing when the container has split them apart.

This applies to HsValBinds and ClassDecl, ClsInstDecl.

When making modifications to the list of declarations, the new order must be captured for when it must be printed. For each list of declarations (binds and sigs for a HsValBind) we can just store the list in order.

To recreate the list when printing, we must merge them, and this is what the AnnSortKey records. It used to be indexed by SrcSpan, we now simply index by a marker as to which list to take the next item from.

Merge request reports