import Digraph ( SCC(..), stronglyConnComp )
import Bag
import Outputable
-import Maybes ( orElse, fromJust, isJust )
+import Maybes ( orElse, isJust )
import Util ( filterOut )
import Monad ( foldM )
\end{code}
keyd_nodes = bagToList binds_w_dus `zip` [0::Int ..]
- edges = [ (node, key, [fromJust mb_key | n <- nameSetToList uses,
- let mb_key = lookupNameEnv key_map n,
- isJust mb_key ])
+ edges = [ (node, key, [key | n <- nameSetToList uses,
+ Just key <- [lookupNameEnv key_map n] ])
| (node@(_,_,uses), key) <- keyd_nodes ]
key_map :: NameEnv Int -- Which binding it comes from
rnGRHS' ctxt (GRHS guards rhs)
= do { opt_GlasgowExts <- doptM Opt_GlasgowExts
- ; checkM (opt_GlasgowExts || is_standard_guard guards)
- (addWarn (nonStdGuardErr guards))
-
; ((guards', rhs'), fvs) <- rnStmts (PatGuard ctxt) guards $
rnLExpr rhs
+
+ ; checkM (opt_GlasgowExts || is_standard_guard guards')
+ (addWarn (nonStdGuardErr guards'))
+
; return (GRHS guards' rhs', fvs) }
where
-- Standard Haskell 1.4 guards are just a single boolean
= hang (ptext SLIT("Bindings in hs-boot files are not allowed"))
2 (ppr mbinds)
-nonStdGuardErr guard
- = hang (ptext
- SLIT("accepting non-standard pattern guards (-fglasgow-exts to suppress this message)")
- ) 4 (ppr guard)
+nonStdGuardErr guards
+ = hang (ptext SLIT("accepting non-standard pattern guards (-fglasgow-exts to suppress this message)"))
+ 4 (interpp'SP guards)
\end{code}