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

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. Best, Ryan ----- [1] https://github.com/ghc-proposals/ghc-proposals/discussions/456

On Sat, Sep 16, 2023 at 08:45:59AM -0400, Ryan Scott wrote:
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.
[1] https://github.com/ghc-proposals/ghc-proposals/discussions/456
Very interesting. Thanks Ryan!
participants (2)
-
Ryan Scott
-
Tom Ellis