summaryrefslogtreecommitdiff
path: root/compiler/specialise/Specialise.lhs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-05-02 15:44:14 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-05-02 15:44:14 +0100
commitac230c5ef652e27f61d954281ae6a3195e1f9970 (patch)
tree4cd59d3ca670916f64bcfe9c0c3f72f21a272e42 /compiler/specialise/Specialise.lhs
parentb04c0beb951b2e69f76f724a4e72b98c896b468a (diff)
downloadhaskell-ac230c5ef652e27f61d954281ae6a3195e1f9970.tar.gz
Allow cases with empty alterantives
This patch allows, for the first time, case expressions with an empty list of alternatives. Max suggested the idea, and Trac #6067 showed that it is really quite important. So I've implemented the idea, fixing #6067. Main changes * See Note [Empty case alternatives] in CoreSyn * Various foldr1's become foldrs * IfaceCase does not record the type of the alternatives. I added IfaceECase for empty-alternative cases. * Core Lint does not complain about empty cases * MkCore.castBottomExpr constructs an empty-alternative case expression (case e of ty {}) * CoreToStg converts '(case e of {})' to just 'e'
Diffstat (limited to 'compiler/specialise/Specialise.lhs')
-rw-r--r--compiler/specialise/Specialise.lhs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/specialise/Specialise.lhs b/compiler/specialise/Specialise.lhs
index 321deb866a..6c80f8fbde 100644
--- a/compiler/specialise/Specialise.lhs
+++ b/compiler/specialise/Specialise.lhs
@@ -1037,12 +1037,12 @@ specCalls subst rules_for_me calls_for_me fn rhs
= WARN( notNull calls_for_me, ptext (sLit "Missed specialisation opportunity for")
<+> ppr fn $$ _trace_doc )
-- Note [Specialisation shape]
- -- pprTrace "specDefn: none" (ppr fn $$ ppr calls_for_me) $
+ -- pprTrace "specDefn: none" (ppr fn <+> ppr calls_for_me) $
return ([], [], emptyUDs)
where
- _trace_doc = vcat [ ppr rhs_tyvars, ppr n_tyvars
- , ppr rhs_ids, ppr n_dicts
- , ppr (idInlineActivation fn) ]
+ _trace_doc = sep [ ppr rhs_tyvars, ppr n_tyvars
+ , ppr rhs_ids, ppr n_dicts
+ , ppr (idInlineActivation fn) ]
fn_type = idType fn
fn_arity = idArity fn