import DsMonad
import DsUtils
import PrelInfo ( nON_EXHAUSTIVE_GUARDS_ERROR_ID )
-import Unique ( otherwiseIdKey, trueDataConKey, Uniquable(..) )
-import Outputable
+import Unique ( otherwiseIdKey, trueDataConKey, hasKey, Uniquable(..) )
\end{code}
@dsGuarded@ is used for both @case@ expressions and pattern bindings.
-- 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 ->
\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}