- ; let (bndrs, body) = collectBinders (occurAnalyseExpr ds_spec_expr)
- -- ds_spec_expr may look like
- -- /\a. f a Int dOrdInt
- -- or /\a.\d:Ord a. let { dl::Ord [a] = dOrdList a d } in f [a] dl
- -- The occurrence-analysis does two things
- -- (a) identifies unused binders: Note [Unused spec binders]
- -- (b) sorts dict bindings into NonRecs
- -- so they can be inlined by decomposeRuleLhs
- mb_lhs = decomposeRuleLhs body
-
- -- Check for dead binders: Note [Unused spec binders]
- ; case filter isDeadBinder bndrs of {
- bs | not (null bs) -> do { warnDs (dead_msg bs); return Nothing }
- | otherwise ->
+ ; case (decomposeRuleLhs ds_spec_expr) of {
+ Nothing -> do { warnDs decomp_msg; return Nothing } ;