When flattening, try reducing type-family applications eagerly
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 10 Dec 2014 13:54:17 +0000 (13:54 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 10 Dec 2014 16:01:17 +0000 (16:01 +0000)
commitbcb967abaaa51df281b70d905df915b6b4bb31cc
treea027f30a908875f7cb64c0cbf476fbd7db1970c8
parent3e234f73c0a5537bdaf518d0ace375541f158a47
When flattening, try reducing type-family applications eagerly

This short-cut can improve performance quite a bit, by short-circuiting
the process of creating a fresh constraint and binding for each reduction.

See Note [Reduce type family applications eagerly] in TcFlatten

To do this I had to generalise the inert_flat_cache a bit, so that the
rhs is not necessarily a type variable; but nothing fundamental.
compiler/typecheck/TcCanonical.hs
compiler/typecheck/TcFlatten.hs
compiler/typecheck/TcSMonad.hs