summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsListComp.hs
diff options
context:
space:
mode:
authorSebastian Graf <sgraf1337@gmail.com>2019-10-01 18:55:23 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-11 22:10:12 -0400
commit30f5ac07a4843b42ed479462661e9d79f038cf09 (patch)
tree506d6ab13ff03a8c095c11a71b03b9ae4222203b /compiler/deSugar/DsListComp.hs
parentd584e3f08cfee6e28b70bf53c573d86e44f326f8 (diff)
downloadhaskell-30f5ac07a4843b42ed479462661e9d79f038cf09.tar.gz
Much simpler language for PmCheck
Simon realised that the simple language composed of let bindings, bang patterns and flat constructor patterns is enough to capture the semantics of the source pattern language that are important for pattern-match checking. Well, given that the Oracle is smart enough to connect the dots in this less informationally dense form, which it is now. So we transform `translatePat` to return a list of `PmGrd`s relative to an incoming match variable. `pmCheck` then trivially translates each of the `PmGrd`s into constraints that the oracle understands. Since we pass in the match variable, we incidentally fix #15884 (coverage checks for view patterns) through an interaction with !1746.
Diffstat (limited to 'compiler/deSugar/DsListComp.hs')
-rw-r--r--compiler/deSugar/DsListComp.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/deSugar/DsListComp.hs b/compiler/deSugar/DsListComp.hs
index e826045eb5..943b00d71d 100644
--- a/compiler/deSugar/DsListComp.hs
+++ b/compiler/deSugar/DsListComp.hs
@@ -279,7 +279,7 @@ deBindComp pat core_list1 quals core_list2 = do
let u3_ty@u1_ty = exprType core_list1 -- two names, same thing
-- u1_ty is a [alpha] type, and u2_ty = alpha
- let u2_ty = hsLPatType pat
+ let u2_ty = hsPatType pat
let res_ty = exprType core_list2
h_ty = u1_ty `mkVisFunTy` res_ty
@@ -373,7 +373,7 @@ dfBindComp :: Id -> Id -- 'c' and 'n'
-> DsM CoreExpr
dfBindComp c_id n_id (pat, core_list1) quals = do
-- find the required type
- let x_ty = hsLPatType pat
+ let x_ty = hsPatType pat
let b_ty = idType n_id
-- create some new local id's