GHC: Ticket #2859: Reduce coercion terms to normal form
http://ghc.haskell.org/trac/ghc/ticket/2859
<p>
Sometimes coercion terms in a Core program grow absurdly big, and can readily be simplified to be much more compact. Example:
</p>
<ul><li> <a class="closed ticket" href="http://ghc.haskell.org/trac/ghc/ticket/2627" title="#2627: bug: GADT + Type family doesn't unify like I expect (closed: fixed)">#2627</a>
</li><li> <a class="closed ticket" href="http://ghc.haskell.org/trac/ghc/ticket/2440" title="#2440: bug: Bad code with type families (closed: fixed)">#2440</a>
</li></ul><p>
Big coercion terms have no runtime impact, but they may make compilation slower.
</p>
<p>
I speculate that it should be possible to use transformations such as those Max suggests in his comment on <a class="closed ticket" href="http://ghc.haskell.org/trac/ghc/ticket/2440" title="#2440: bug: Bad code with type families (closed: fixed)">#2440</a>, as a confluent, terminating rewriting system that makes coercion terms smaller, or, better still, rewrites them to a normal form. Then we can use "smart constructors" for coercion terms, so that they are always kept in normal form.
</p>
<p>
Identity coercions occur a lot, but are not so easy to recognise. I've also wondered about having some special representation for the identity.
</p>
<p>
This ticket is to remind us to look for such a rewrite system. Max, perhaps?
</p>
en-usGHChttp://ghc.haskell.org/trac/ghc/chrome/site/ghc_logo.png
http://ghc.haskell.org/trac/ghc/ticket/2859
Trac 1.2guestMon, 26 Oct 2009 20:00:02 GMTcc changed
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:1
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:1
<ul>
<li><strong>cc</strong>
<em>tom.schrijvers@…</em> added
</li>
</ul>
TicketsimonmarMon, 16 Nov 2009 13:27:27 GMTfailure set
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:2
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:2
<ul>
<li><strong>failure</strong>
set to <em>Compile-time performance bug</em>
</li>
</ul>
TicketiglooFri, 30 Apr 2010 16:40:36 GMTmilestone changed
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:3
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:3
<ul>
<li><strong>milestone</strong>
changed from <em>6.12 branch</em> to <em>6.12.3</em>
</li>
</ul>
TicketiglooSat, 19 Jun 2010 16:58:26 GMTpriority, milestone changed
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:4
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:4
<ul>
<li><strong>priority</strong>
changed from <em>normal</em> to <em>low</em>
</li>
<li><strong>milestone</strong>
changed from <em>6.12.3</em> to <em>6.14.1</em>
</li>
</ul>
TicketsimonpjWed, 15 Sep 2010 21:27:18 GMTstatus changed; resolution set
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:5
http://ghc.haskell.org/trac/ghc/ticket/2859#comment:5
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
<p>
I implemented a coercion optimiser, some time ago. Hurrah.
</p>
Ticket