B-Lang-org / bsc

Bluespec Compiler (BSC)
Other
954 stars 146 forks source link

comp: remove most imports of `Data.Generics` #722

Open thoughtpolice opened 4 months ago

thoughtpolice commented 4 months ago

99% of the uses of the Data.Generics import from syb was to qualify the names Data and Typeable, but these have long since been available directly in base along with DeriveDataTypeable for many years now. The syb exports are in fact just re-exports from base. Migrate most of the code to just use Data.Data directly instead.

At the same time, this touches up some of the import lists to be a little more consistent but is otherwise functionally identical.

Vekhir commented 2 months ago

Does "long since" include GHC 7.10.3, or will this increase the minimum GHC version? If so, do you know what version?

Data.Data exists since base 4.6.0.1: https://hackage.haskell.org/package/base-4.6.0.1/docs/Data-Data.html#t:Data That's the oldest I could find. This corresponds to GHC 7.6 or later, so the current bounds are fine. Not done here, but the DeriveDataTypeable language extension is enabled by default since GHC 7.10 (source). It's mentioned in the OP.