[commit: ghc] supercompiler: Cast things are cheap as well (a1ba5fe)

Max Bolingbroke <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : supercompiler

http://hackage.haskell.org/trac/ghc/changeset/a1ba5fe37c31d588e88e28d7528113ad5f5adef0

>---------------------------------------------------------------

commit a1ba5fe37c31d588e88e28d7528113ad5f5adef0
Author: Max Bolingbroke <[email protected]>
Date:   Thu Aug 4 12:04:19 2011 +0100

    Cast things are cheap as well

>---------------------------------------------------------------

 compiler/supercompile/Supercompile/Core/Syntax.hs |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/compiler/supercompile/Supercompile/Core/Syntax.hs b/compiler/supercompile/Supercompile/Core/Syntax.hs
index ad08f74..0444fc9 100644
--- a/compiler/supercompile/Supercompile/Core/Syntax.hs
+++ b/compiler/supercompile/Supercompile/Core/Syntax.hs
@@ -176,6 +176,7 @@ termIsCheap = isCheap . extract
     isCheap _ | cALL_BY_NAME = True -- A cunning hack. I think this is all that should be required...
     isCheap (Var _)         = True
     isCheap (Value _)       = True
+    isCheap (Cast e _)      = isCheap (extract e)
     isCheap (Case e _ _ []) = isCheap (extract e) -- NB: important for pushing down let-bound applications of ``error''
     isCheap _               = False
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.