Fix #10859 by using foldr1 while deriving Eq instances
authorChaitanya Koparkar <ckoparkar@gmail.com>
Mon, 27 Aug 2018 12:07:08 +0000 (14:07 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sun, 16 Sep 2018 16:31:17 +0000 (12:31 -0400)
commitbc907262b40d09b479d100875b26f1add352523a
tree2815a18d2d06537a4b74ad9e7ddfad832b317d32
parentebc8ebf89332ddac3039ff87331c4c053ae516ea
Fix #10859 by using foldr1 while deriving Eq instances

Summary:
Previously, we were using foldl1 instead, which led to the derived
code to be wrongly associated.

Test Plan: ./validate

Reviewers: RyanGlScott, nomeata, simonpj, bgamari

Reviewed By: RyanGlScott, nomeata

Subscribers: rwbarton, carter

GHC Trac Issues: #10859

Differential Revision: https://phabricator.haskell.org/D5104

(cherry picked from commit 2d953a60489ba30433e5f2fe27c50aa9da75f802)
compiler/typecheck/TcGenDeriv.hs