Record Pattern Synonym Cleanup
Ben comments that there are some loose ends with record pattern synonyms (Phab:D1152),
- It's still not clear to me that the free variables produced in
rnPatSynBindare correct - Perhaps in the future we want to refactor
tc_singleto use a function which extends the typechecking environment instead of usingsetGblEnv -
@mpickering's suggested refactoring of
RecSelIdtoRecSelId (Either PatSyn TyCon) Booldescribed in the comment inTcExpr.hs - There is a TODO in
tc_patsyn_finishwhich should either be clarified so it can be considered actionable, removed, or just fixed
The comment from TcExpr was:
I tried to refactor
RecSelIdtoRecSelId [DataCon] Boolbut this causes some pain when it comes to the interface files. Next try it is something likeRecSelId (Either PatSyn TyCon) Boolwith the aim for something better in the future.
Edited by Ben Gamari