Give lookupGRE_Name a better API
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 23 Jun 2016 07:47:31 +0000 (08:47 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Thu, 23 Jun 2016 08:22:53 +0000 (09:22 +0100)
commit3e0af469c97d34bea92032d54d155afc65bd4b20
tree63548506546b50bf1af78d82ba92340d77d42510
parent210a2e122ce3b7c56c780e4541b9f222abe7d2f7
Give lookupGRE_Name a better API

lookupGRE_Name should return either zero or one GREs, never
several. This is a consequence of INVARIANT 1 on GlobalRdrEnv.

So it's better if it returns a Maybe; the panic on multiple results
is put in one place, instead of being scattered or ignored.

Just refactoring, no change in behaviour
compiler/basicTypes/RdrName.hs
compiler/main/InteractiveEval.hs
compiler/rename/RnEnv.hs
compiler/rename/RnNames.hs
compiler/rename/RnPat.hs
compiler/rename/RnSource.hs
compiler/typecheck/FamInst.hs
compiler/typecheck/TcDeriv.hs
compiler/typecheck/TcErrors.hs
compiler/typecheck/TcForeign.hs