
Hi Simon, On Mon, 9 Dec 2013, Simon Marlow wrote:
I think pattern synonyms are great! A couple of questions:
* what will Haddock show for a pattern export?
Is Haddock a part of GHC? I don't know. If it's not, then whatever parser it's using will have to be extended to support pattern synonyms.
* can we still write pattern matches that GHC can infer to be exhaustive when using pattern synonyms?
No. I don't see how that would be possible without having access to the pattern synonym definition when typechecking/compiling a use site. One deliberate design decision was to make pattern synonyms proper abstractions, in the sense that compiling use sites shouldn't require access to its definition details.
Are we not doing ViewPatternsAlternative any more? https://ghc.haskell.org/trac/ghc/wiki/ViewPatternsAlternative Or is that just being treated as an orthogonal issue? I rather like that proposal, and we originally discussed it in conjunction with pattern synonyms.
It should be treated as orthogonal -- if and when GHC gets support for it, they will be available in PatternSynonyms as well. If there's no separate Trac ticket for ViewPatternsAlternative yet, I'm happy to open one. Bye, Gergo -- .--= ULLA! =-----------------. \ http://gergo.erdi.hu \ `---= gergo@erdi.hu =-------' I'm sure the pension plan includes all the starvation I can eat.