Pattern synonym type signatures

Dr. ERDI Gergo gergo at
Wed Nov 19 13:48:55 UTC 2014


I have finished the implementation of type signature support for pattern 
synonyms. In the end, I went with the following syntax:

     pattern P :: (Prov b) => (Req a) => a -> b -> Int -> T a

which declares a pattern synonym called `P`, with argument types `a`, `b`,
and `Int`, and result type `T a`, with provided context `(Prov b)` and 
required context `(Req a)`.

This has the advantage that it doesn't require new syntax at all (no 
funky `;` business in the contexts), and avoids the 'pattern type' 
monstrosity that Edward Kmett rightfully hated.

I plan to finish up the branch tomorrow (by updating the documentation), 
and then merging it into master. That is still within the feature freeze 
window, right? Also, if anything comes up tomorrow and I cannot finish it 
after all, it'd be a real bummer not to get this into GHC 7.10. So the 
reason I'm sending this email now is to just make sure that it will make 
its way into 7.10.


More information about the ghc-devs mailing list