Pattern Synonyms and type families
Haskell Community [Unofficial]
June 1, 2026
ashokkimmel:
If you require an explicit annotation on the
pattern, …
I like Adam’s type synonym trick. (Should have thought of it myself.) More to the point, I guess ‘promotable’ PattSyns are exactly those for which a type syn can be defined. Then …
- a bit of Template Haskell to make two declarations; or
- a bit of cpp.
In effect by declaring both, you’re saying: I hereby annotate the PattSyn to make it promotable.
Discussion in the ATmosphere