import {-# SOURCE #-} Match ( matchSinglePat )
import HsSyn
+import MkCore
import CoreSyn
import Var
import Type
import DsMonad
import DsUtils
-import PrelInfo
import TysWiredIn
import PrelNames
import Name
dsGRHS :: HsMatchContext Name -> [Pat Id] -> Type -> LGRHS Id -> DsM MatchResult
dsGRHS hs_ctx _ rhs_ty (L _ (GRHS guards rhs))
- = matchGuards (map unLoc guards) hs_ctx rhs rhs_ty
+ = matchGuards (map unLoc guards) (PatGuard hs_ctx) rhs rhs_ty
\end{code}
\begin{code}
matchGuards :: [Stmt Id] -- Guard
- -> HsMatchContext Name -- Context
+ -> HsStmtContext Name -- Context
-> LHsExpr Id -- RHS
-> Type -- Type of RHS of guard
-> DsM MatchResult
matchGuards (BindStmt pat bind_rhs _ _ : stmts) ctx rhs rhs_ty = do
match_result <- matchGuards stmts ctx rhs rhs_ty
core_rhs <- dsLExpr bind_rhs
- matchSinglePat core_rhs ctx pat rhs_ty match_result
+ matchSinglePat core_rhs (StmtCtxt ctx) pat rhs_ty match_result
isTrueLHsExpr :: LHsExpr Id -> Maybe (CoreExpr -> DsM CoreExpr)