[project @ 2000-12-06 13:03:28 by simonmar]
[ghc-hetmet.git] / ghc / compiler / deSugar / DsGRHSs.lhs
index e5b823b..b14e264 100644 (file)
@@ -13,14 +13,13 @@ import {-# SOURCE #-} Match   ( matchSinglePat )
 
 import HsSyn           ( Stmt(..), HsExpr(..), GRHSs(..), GRHS(..) )
 import TcHsSyn         ( TypecheckedGRHSs, TypecheckedPat, TypecheckedStmt )
-import CoreSyn         ( CoreExpr, Bind(..) )
+import CoreSyn         ( CoreExpr )
 import Type            ( Type )
 
 import DsMonad
 import DsUtils
 import PrelInfo                ( nON_EXHAUSTIVE_GUARDS_ERROR_ID )
-import Unique          ( otherwiseIdKey, trueDataConKey, Uniquable(..) )
-import Outputable
+import PrelNames       ( otherwiseIdKey, trueDataConKey, hasKey )
 \end{code}
 
 @dsGuarded@ is used for both @case@ expressions and pattern bindings.
@@ -81,11 +80,9 @@ matchGuard (ExprStmt expr locn : should_be_null) ctx
 
        -- Turn an "otherwise" guard is a no-op
 matchGuard (GuardStmt (HsVar v) _ : stmts) ctx
-  |  uniq == otherwiseIdKey
-  || uniq == trueDataConKey
+  |  v `hasKey` otherwiseIdKey
+  || v `hasKey` trueDataConKey
   = matchGuard stmts ctx
-  where
-    uniq = getUnique v
 
 matchGuard (GuardStmt expr locn : stmts) ctx
   = matchGuard stmts ctx               `thenDs` \ match_result ->
@@ -107,4 +104,4 @@ Should {\em fail} if @e@ returns @D@
 \begin{verbatim}
 f x | p <- e', let C y# = e, f y# = r1
     | otherwise         = r2 
-\end{verbatim}
\ No newline at end of file
+\end{verbatim}