X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FdeSugar%2FDsGRHSs.lhs;h=b14e264d4005231425a57a4204085ef9a0fa54f6;hb=d364541154457a49e3c35d671d7a1b57c9c4cca3;hp=e5b823b32d2c2846e1498091e3e1644db87bf77c;hpb=a61995821fca70c4d62769757d6808ebbc970e12;p=ghc-hetmet.git diff --git a/ghc/compiler/deSugar/DsGRHSs.lhs b/ghc/compiler/deSugar/DsGRHSs.lhs index e5b823b..b14e264 100644 --- a/ghc/compiler/deSugar/DsGRHSs.lhs +++ b/ghc/compiler/deSugar/DsGRHSs.lhs @@ -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}