External Publication
Visit Post

Pattern Synonyms and type families

Haskell Community [Unofficial] May 31, 2026
Source

dyaitskov:

pattern synonyms cannot be promoted

In general, the RHS of a PattSyn declaration can be an arbitrarily complex expression (often using ViewPatterns), and not necessarily yielding a datatype that’s promotable — that is, the compiler must evaluate the call to find out; possibly it hasn’t yet processed the PattSyn declaration[**]. TFs are already at the bleeding edge of type-trickery. So to me this sounds just too hard.

If you think this is an enhancement that would benefit the community, I suggest you raise a brief/informal ‘Issue’ on github. I think you’ll need a more persuasive use case than the one you give: I see no real saving or increase in expressivity.

[**] The PattSyn’s signature might itself be given using a TF call. So now we’re invading the compiler’s workstream.

Discussion in the ATmosphere

Loading comments...