When reading Data.List.NonEmpty.Extra, I noticed conditionals (#if) querying the GHC version to avoid clashes with new functions introduced into base.
|
#if __GLASGOW_HASKELL__ <= 910 |
These conditionals should really query the version of
base instead.
There is a comprehensive translation table at
https://www.snoyman.com/base/ .
Also, maybe more importantly, the current pattern of conditionals will lead to different APIs exported by Data.List.NonEmpty.Extra depending on which version of GHC it was compiled with.
This is suboptimal, to say the least.
The exported API should be stable across GHC (and base) versions.
So functions that entered base later should simply be reexported, not dropped from the API.
The current logic is like a virus: users in multi-GHC settings have to replicate analogous conditionals if they want to import such only conditionally present functions.
When reading
Data.List.NonEmpty.Extra, I noticed conditionals (#if) querying the GHC version to avoid clashes with new functions introduced intobase.extra/src/Data/List/NonEmpty/Extra.hs
Line 142 in c9ac297
These conditionals should really query the version of
baseinstead.There is a comprehensive translation table at https://www.snoyman.com/base/ .
Also, maybe more importantly, the current pattern of conditionals will lead to different APIs exported by
Data.List.NonEmpty.Extradepending on which version of GHC it was compiled with.This is suboptimal, to say the least.
The exported API should be stable across GHC (and
base) versions.So functions that entered
baselater should simply be reexported, not dropped from the API.The current logic is like a virus: users in multi-GHC settings have to replicate analogous conditionals if they want to import such only conditionally present functions.