Closed mvoidex closed 8 years ago
Thank you for your contribution! Why the second commit, what was wrong? I am asking because I want to add tests.
By first commit only "exporting" was implemented, i.e. PatSyns were processed in getTopDeclSymbols
. But names resolving was still incorrent. It's a bit tricky, for example:
pattern Foo x y = Just ([x], Right y)
Here we will have PatSyn _ p r _
(p :: Pat
= Foo x y
, q :: Pat
= Just ([x], Right y)
).
Here p
is Pat
and it must bind not only Name
s (x
, y
), but even QName
s (Foo
), which are never binded by default. And q
must not bind anything, only try to resolve, therefore Resolvable Pat
works different whether it's usual Pat
or Pat
from PatSyn
. And same thing for PatField
as part of Pat
.
I also haven't tested resolving of pattern synonym usage (only in export list and in pattern synonym declaration), so I think I'll add some new commits here when I have time to.
Seems ready to merge
Thanks :)
Pattern synonyms were ignored. Now there is new
PatSyn
value inSymbol
. Fields exported as selectors.