diff --git a/compiler/supercompile/Supercompile/Core/Syntax.hs b/compiler/supercompile/Supercompile/Core/Syntax.hs index ad08f7478e68733678242454f8163e6e04b3bae1..0444fc910b4b811b992b71030a0caaef39710790 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