An accumulator to build a prefix data constructor, e.g. when parsing
MkT A B C, the accumulator will evolve as follows:
1. PrefixDataConBuilder [] MkT
2. PrefixDataConBuilder [A] MkT
3. PrefixDataConBuilder [A, B] MkT
4. PrefixDataConBuilder [A, B, C] MkT
There are two reasons we have a separate builder type instead of using
HsConDeclDetails GhcPs directly:
- It's faster, because OrdList gives us constant-time
snoc.
- Having a separate type helps ensure that we don't forget to
finalize a RecTy into a RecCon (we do that in
dataConBuilderDetails).
See Note [PatBuilder] for another builder type used in the parser.
Here the technique is similar, but the motivation is different.