Rewrite coercionRole. (#9233)
authorRichard Eisenberg <eir@cis.upenn.edu>
Wed, 16 Jul 2014 02:32:29 +0000 (22:32 -0400)
committerRichard Eisenberg <eir@cis.upenn.edu>
Wed, 16 Jul 2014 18:20:51 +0000 (14:20 -0400)
commit34ec0bd942b732b127b1a955cd3508da0a588b6f
treedb55dd8c9cfead2616dab896258ac485fc909468
parenta065f9d3bd3d1d1b02c9552c3c2763bcd8aed6da
Rewrite coercionRole. (#9233)

Summary:
coercionRole is now much more efficient, computing both the coercion's
kind and role together. The previous version calculated them separately,
leading to quite possibly exponential behavior.

This is still too slow, but it's a big improvement.

Test Plan: Evaluate by running the "minimized" test from the Trac ticket.

Reviewers: simonpj, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D73
compiler/coreSyn/MkCore.lhs
compiler/types/Coercion.lhs
compiler/types/OptCoercion.lhs