[Haskell-cafe] Why can't I promote data family constructors, and what to do instead?

Ryan Scott ryan.gl.scott at gmail.com
Sat Sep 16 12:45:59 UTC 2023

Regarding the first question ("Is this restriction *really* necessary?"), I
think the answer is likely "no", at least for most data family instances.
This discussion [1] is the most up-to-date reference on the history and
motivations behind the current restriction. In that discussion, it is
hypothesized that data family instances whose data constructors do not use
any constraints could be promoted without needing to rethink how Core
works. (If I understand correctly, all of your data family instances fall
into this simple subset.) This discussion could provide a template for a
GHC proposal that proposes to allow this feature.


[1] https://github.com/ghc-proposals/ghc-proposals/discussions/456
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20230916/1c12a1e8/attachment.html>

More information about the Haskell-Cafe mailing list