import BasicTypes ( Activation( AlwaysActive ) )
import Bag
import List ( partition )
-import Util ( zipEqual, zipWithEqual, cmpList, lengthIs,
- equalLength, lengthAtLeast, notNull )
+import Util
import Outputable
import FastString
spec_alt (con, args, rhs) = do
(rhs', uds) <- specExpr subst_rhs rhs
- let (uds', rhs'') = do dumpUDs args uds rhs'
+ let (uds', rhs'') = dumpUDs args uds rhs'
return ((con, args', rhs''), uds')
where
(subst_rhs, args') = substBndrs subst_alt args
rhs_uds `plusUDs` plusUDList spec_uds)
| otherwise -- No calls or RHS doesn't fit our preconceptions
- = WARN( notNull calls_for_me, ptext SLIT("Missed specialisation opportunity for") <+> ppr fn ) do
+ = WARN( notNull calls_for_me, ptext (sLit "Missed specialisation opportunity for") <+> ppr fn )
-- Note [Specialisation shape]
- (rhs', rhs_uds) <- specExpr subst rhs
- return ((fn, rhs'), [], rhs_uds)
+ (do { (rhs', rhs_uds) <- specExpr subst rhs
+ ; return ((fn, rhs'), [], rhs_uds) })
where
fn_type = idType fn
where
my_zipEqual doc xs ys
-#ifdef DEBUG
- | not (equalLength xs ys) = pprPanic "my_zipEqual" (vcat
+ | debugIsOn && not (equalLength xs ys)
+ = pprPanic "my_zipEqual" (vcat
[ ppr xs, ppr ys
, ppr fn <+> ppr call_ts
, ppr (idType fn), ppr theta
, ppr n_dicts, ppr rhs_dicts
, ppr rhs])
-#endif
| otherwise = zipEqual doc xs ys
\end{code}
-- Return the substitution to use for RHSs, and the one to use for the body
cloneBindSM subst (NonRec bndr rhs) = do
us <- getUniqueSupplyM
- let (subst', bndr') = do cloneIdBndr subst us bndr
+ let (subst', bndr') = cloneIdBndr subst us bndr
return (subst, subst', NonRec bndr' rhs)
cloneBindSM subst (Rec pairs) = do