Suppress redundant givens during error reporting

Authored by RyanGlScott on Aug 12 2018, 10:27 AM.

Description

Suppress redundant givens during error reporting

Summary:
When GHC reports that it cannot solve a constraint in error
messages, it often reports what given constraints it has in scope.
Unfortunately, sometimes redundant constraints (like * ~ *,
from Trac #15361) can sneak in. The fix is simple: blast away these
redundant constraints using mkMinimalBySCs.

Test Plan: make test TEST=T15361

Reviewers: simonpj, bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: Trac #15361

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

(cherry picked from commit c552feea127d8ed8cbf4994a157c4bbe254b96c3)