Excellent bikeshedding opportunity! Frontend syntax for pattern synonym types

Dr. ERDI Gergo gergo at erdi.hu
Wed Dec 25 03:59:12 UTC 2013


On Tue, 24 Dec 2013, Tsuyoshi Ito wrote:

> Thank you for your prompt reply.  Now the ordering makes sense.  To be
> honest, I still find it a little confusing even after knowing that the
> order is logical, but maybe it is just a matter of getting used to it.

So just to make my position clear: I don't think that syntax is good, it's 
just the best we've come up with so far:) And the problem is exactly this, 
that it's not intuitive at all.

One source of solace might be that 'provided' contexts will only pop up 
when you use GADTs with typeclass-constrained constructors, so for less
'power-user' cases, the signature simplifies to something like this:

pattern P Bool t :: (Show t) => [t]

> Also thank you for the clarification that higher-order pattern
> functions are outside the scope of the current work.  Now I am curious
> about if/how higher-order pattern functions are useful, how their
> types can be described, and so on.  If they have any applications,
> they may be a candidate for future work.

I don't have an insight to offer on this at this point. However, I feel
there's a huge qualitative difference between higher-order and 
non-higher-order pattern synonyms in the amount of new concepts that they 
introduce. I would even go so far as to recommend waiting until a stable 
GHC release with pattern synonyms (i.e. GHC 7.10 or 8.0 or whatever the 
next one will be called), and looking at real world usage of them, before 
jumping into higher-order patsyns.


More information about the Glasgow-haskell-users mailing list