Skip to content

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 rnPatSynBind are correct
  • Perhaps in the future we want to refactor tc_single to use a function which extends the typechecking environment instead of using setGblEnv
  • @mpickering's suggested refactoring of RecSelId to RecSelId (Either PatSyn TyCon) Bool described in the comment in TcExpr.hs
  • There is a TODO in tc_patsyn_finish which should either be clarified so it can be considered actionable, removed, or just fixed

The comment from TcExpr was:

I tried to refactor RecSelId to RecSelId [DataCon] Bool but this causes some pain when it comes to the interface files. Next try it is something like RecSelId (Either PatSyn TyCon) Bool with the aim for something better in the future.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information