summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsListComp.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-12 18:52:05 +0100
committerIan Lynagh <igloo@earth.li>2012-06-12 18:52:05 +0100
commitab50c9c527d19f4df7ee6742b6d79c855d57c9b8 (patch)
treeac78c3fda6f3a8ec8235345f7b02518e0d809ba0 /compiler/deSugar/DsListComp.lhs
parent543ec0852722318665d2f5228e29d44a5fc973f5 (diff)
downloadhaskell-ab50c9c527d19f4df7ee6742b6d79c855d57c9b8.tar.gz
Pass DynFlags down to showSDoc
Diffstat (limited to 'compiler/deSugar/DsListComp.lhs')
-rw-r--r--compiler/deSugar/DsListComp.lhs10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/deSugar/DsListComp.lhs b/compiler/deSugar/DsListComp.lhs
index 74fe642f1e..efe14f2678 100644
--- a/compiler/deSugar/DsListComp.lhs
+++ b/compiler/deSugar/DsListComp.lhs
@@ -820,14 +820,16 @@ dsMcBindStmt pat rhs' bind_op fail_op stmts
handle_failure pat match fail_op
| matchCanFail match
= do { fail_op' <- dsExpr fail_op
- ; fail_msg <- mkStringExpr (mk_fail_msg pat)
+ ; dflags <- getDynFlags
+ ; fail_msg <- mkStringExpr (mk_fail_msg dflags pat)
; extractMatchResult match (App fail_op' fail_msg) }
| otherwise
= extractMatchResult match (error "It can't fail")
- mk_fail_msg :: Located e -> String
- mk_fail_msg pat = "Pattern match failure in monad comprehension at " ++
- showSDoc (ppr (getLoc pat))
+ mk_fail_msg :: DynFlags -> Located e -> String
+ mk_fail_msg dflags pat
+ = "Pattern match failure in monad comprehension at " ++
+ showPpr dflags (getLoc pat)
-- Desugar nested monad comprehensions, for example in `then..` constructs
-- dsInnerMonadComp quals [a,b,c] ret_op