Type applications in constructor patterns will require the TypeAbstractions extension starting from GHC 9.12
I just tried GHC HEAD on one of my projects and got
test/Main.hs:418:14: warning: [GHC-69797]
Type applications in constructor patterns will require
the TypeAbstractions extension starting from GHC 9.12.
Suggested fix: Perhaps you intended to use TypeAbstractions
|
418 | SomeWordN (WordN @n1 i1) == SomeWordN (WordN @n2 i2) =
|
I assume that the changes have been properly approved by GHC SC, so feel free to skip until "(Not rant)" section.
(Rant) I'm quite unhappy when GHC refines language pragmas and forces me to make changes. I have a perfectly valid program using {-# LANGUAGE TypeApplications #-}
, a part of GHC2021
standard. Suddenly GHC 9.9 (and presumably future GHC 9.10) decides to change its semantics (why?) and says this is no longer good enough and forces me to add {-# LANGUAGE TypeAbstractions #-}
. Mind you that the latter has been just introduced in GHC 9.8 and is marked as "partially implemented", so as a developer I don't even know what I'm opting in. And the warning says that my program will stop compiling with GHC 9.12. This is just a gratuitous breakage out of some religious zeal on behalf of GHC: if it knows what I meant and can compile just fine, please assume TypeAbstractions
or whatever needed transparently.
Breaking existing users for the sake of far-fetched Dependent Haskell (?) benefits is a way to nowhere.
(Not rant) Could someone please suggest a migration strategy? How can we maintain backward compatibility, ideally without CPP and warnings, when TypeAbstractions
has been just introduced in GHC 9.8, but will be mandatory as soon as GHC 9.12?