Do GHC2021 and GHC2024 not do what you want?

Again, those are _GHC_ extensions, not "standard" Haskell. At this point it's not Haskell, it's Glasgow Haskell.

And those features are not a library that you just throw in, they are compiler specific.