Use dischargeFunEq consistently

Authored by simonpj on May 23 2018, 7:06 AM.


Use dischargeFunEq consistently

Trac Trac #15122 turned out to be interesting.

  • Were calling dischargeFmv in three places.
  • In all three cases we dealt with the Given case separately.
  • In two of the three cases the Given code was right, (albeit duplicated).
  • In the third case (in TcCanonical.canCFunEqCan), we had ; case flav of Given -> return () -- nothing more to do. which was utterly wrong.

The solution is easy: move the Given-case handling into
dischargeFmv (now reenamed dischargeFunEq), and delete it
from the call sites.

Result: less code, easier to understand (dischargeFunEq handles
all three cases, not just two out of three), and Trac Trac #15122 is fixed.