Derive instances in Data.Data
authorRyan Scott <ryan.gl.scott@gmail.com>
Fri, 3 Jun 2016 18:48:16 +0000 (14:48 -0400)
committerRyan Scott <ryan.gl.scott@gmail.com>
Fri, 3 Jun 2016 18:48:17 +0000 (14:48 -0400)
commit4842a8050058bb571db861be3fc5ec03a1b4274b
treec064d01c180a54409c3b78fbaf1fee8366b9d1a6
parent2046297ec03bdcd4901f69cd6ae03e84dc974683
Derive instances in Data.Data

Summary:
Currently, none of the `Data` instances in `Data.Data` are derived,
which has resulted in hundreds of lines of laboriously hand-written `Data`
instances. This cleans it up by using `DeriveDataTypeable` to derive all of
the boring instances.

Note that previously, `tcTopSrcDecls` in `TcRnDriver` was typechecking the
variables generated in `deriving` statements before other top-level variables,
which causes an error when `DeriveDataTypeable` is used in `Data.Data`, since
the `deriving`-generated variable definitions refer to top-level definitions
in `Data.Data` itself. To fix this, the order in which these two groups are
typechecked was reversed.

Test Plan: ./validate

Reviewers: rwbarton, bgamari, hvr, austin

Reviewed By: austin

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D2291
compiler/typecheck/TcRnDriver.hs
libraries/base/Data/Data.hs