Skip to content

GenStgAlt 3-tuple synonym --> Record type

doyougnu requested to merge doyougnu/ghc:wip/StgAlt_ADT into master


This MR changes GenStgAlt from a 3-tuple type synonym to a Record type with field accessors. This is purely a quality of life refactor.


In pursuit of #21078 (closed). Previous iterations of ghcjs used lenses to project from GenStgAlt, obviously we don't want to use lenses in the new js-backend and so making GenStgAlt a proper record type, with field accessors and a small amount of helper functions makes it easier to adapt code for the new js-backend and helps clean up use sites in GHC itself.

Other stuff

I opted to make GenStgAlt strict. The CI showed no issues with making the fields lazy so I felt comfortable defaulting to strict datatypes, especially since anything in GenStgAlt will eventually be consumed.

Merge request reports