Pattern synonym constraints :: Ord a => () => ...

ÉRDI Gergő gergo at erdi.hu
Wed Oct 6 11:14:32 UTC 2021


On Tue, 5 Oct 2021, David Feuer wrote:

> To be clear, the proposal to allow different constraints was accepted, but integrating
> it into the current, incredibly complex, code was well beyond the limited abilities of
> the one person who made an attempt. Totally severing pattern synonyms from constructor
> synonyms (giving them separate namespaces) would be a much simpler design.

The backend side of it shouldn't be too difficult -- after all, we are 
already storing a full `Id` (with type and all) for the builder in 
`PatSyn`, it might as well have a completely different type from the 
matcher `Id`. So in GHC/Tc/TyCl/PatSyn.hs, we can just fiddle with 
`mkPatSynBuilder`.

And so we get to the UX side of this, which is the hairy part and the 
reason I'm not too keen on working on this. As you can see in this 
very thread, pattern types are already quite complex for users.


More information about the Glasgow-haskell-users mailing list