Fix #20590 with another application of mkHsContextMaybe
We were always converting empty GADT contexts to Just []
in GHC.ThToHs
,
which caused the pretty-printer to always print them as () => ...
. This is
easily fixed by using the mkHsContextMaybe
function when converting GADT
contexts so that empty contexts are turned to Nothing
. This is in the same
tradition established in commit 4c87a3d1.
In the process of fixing this, I discovered that the Cxt
argument to
mkHsContextMaybe
is completely unnecessary, as we can just as well check if
the LHsContext GhcPs
argument is empty.
Fixes #20590 (closed).