[ghc-steering-committee] #511 Deep Subsumption, recommendation: accept

Spiwack, Arnaud arnaud.spiwack at tweag.io
Mon Jun 20 13:56:07 UTC 2022

Dear all,

The Deep Subsumption proposal [
https://github.com/ghc-proposals/ghc-proposals/pull/511 ] proposes a new
extension, -XDeepSubsumption, which, when activated, partially reverts the
changes from the Simplified Subsumption proposal.

The Simplified Subsumption breaks more programs than anticipated. Many
don't see any benefit from Simplified Subsumption, just the breakage, and
don't like the eta-expansion that it forces.

-XDeepSubsumption, when activated, restores deep skolemisation and
co/contra-variance of the function arrow (but not deep instantiation, which
doesn't affect the observed breakage). The patch already exists for it, and
is about 400loc.

There are two interesting highlights for me.
- It is proposed that -XDeepSubsumption is activated by default in
Haskell98 and Haskell2010, but not GHC2021. -XDeepSubsumption is orthogonal
to Haskell2010, as far as I can tell, but it gives a cut-off point from
which the recommended behaviour (-XNoDeepSubsumption) is the default.
- Even with -XDeepSubsumption, the Quick Look algorithm assumes that the
function arrow is invariant. The consequences of that are difficult to
anticipate, but there is no known example of a bad behaviour due to that
interaction yet.

The authors also have one unresolved question that I'm bringing to the
committee's attention: should `-XDeepSubsumption` be backported to GHC 9.2?


Despite the fact that this extension is decidedly fork-like, and that it's
a real possibility to see the community split around this (after all, the
motivation for -XDeepSubsumption is a few libraries which were designed to
leverage GHC's deep subsumption, and may very well stay that way in the
foreseeable future). I recommend acceptance. Providing a path to backward
compatibility seems to me like the right thing to do.

I also recommend backporting to GHC 9.2. It should essentially be backward
compatible, and providing an update path that doesn't go directly from 9.0
to 9.4 feels better to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-steering-committee/attachments/20220620/135b304e/attachment.html>

More information about the ghc-steering-committee mailing list