[commit: ghc] master: Use dischargeFunEq consistently (a32c8f7)

git at git.haskell.org git at git.haskell.org
Wed May 23 14:12:02 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a32c8f7514c8192fa064537fb93d5a5c224991a0/ghc

>---------------------------------------------------------------

commit a32c8f7514c8192fa064537fb93d5a5c224991a0
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed May 23 13:06:53 2018 +0100

    Use dischargeFunEq consistently
    
    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 #15122 is fixed.


>---------------------------------------------------------------

a32c8f7514c8192fa064537fb93d5a5c224991a0
 compiler/typecheck/TcCanonical.hs                  | 36 +++++++---------
 compiler/typecheck/TcInteract.hs                   | 49 +++++-----------------
 compiler/typecheck/TcSMonad.hs                     | 34 +++++++++------
 .../tests/indexed-types/should_compile/T15122.hs   | 16 +++++++
 testsuite/tests/indexed-types/should_compile/all.T |  1 +
 5 files changed, 64 insertions(+), 72 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a32c8f7514c8192fa064537fb93d5a5c224991a0


More information about the ghc-commits mailing list