summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-18 18:46:21 +0000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2006-09-18 18:46:21 +0000
commit8ddec564494dc7889ea7aa8b4133f08cf3e64e0c (patch)
tree8fc0f35ab33c1cb8aa70f3678116be6abdfff194
parent5653634ead7a7f31f1a584483e53b23e78b047c2 (diff)
downloadhaskell-8ddec564494dc7889ea7aa8b4133f08cf3e64e0c.tar.gz
Simplify mkDataCon slightly
Sat Aug 5 21:42:48 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * Simplify mkDataCon slightly Fri Jul 14 12:48:50 EDT 2006 simonpj@microsoft.com
-rw-r--r--compiler/basicTypes/DataCon.lhs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/basicTypes/DataCon.lhs b/compiler/basicTypes/DataCon.lhs
index 3eaadf759f..8d300d288c 100644
--- a/compiler/basicTypes/DataCon.lhs
+++ b/compiler/basicTypes/DataCon.lhs
@@ -409,7 +409,10 @@ mkDataCon name declared_infix
eq_spec theta
orig_arg_tys tycon
stupid_theta ids
- = con
+ = ASSERT( not (any isEqPred theta) )
+ -- We don't currently allow any equality predicates on
+ -- a data constructor (apart from the GADT ones in eq_spec)
+ con
where
is_vanilla = null ex_tvs && null eq_spec && null theta
con = ASSERT( is_vanilla || not (isNewTyCon tycon) )
@@ -432,10 +435,9 @@ mkDataCon name declared_infix
-- The 'arg_stricts' passed to mkDataCon are simply those for the
-- source-language arguments. We add extra ones for the
-- dictionary arguments right here.
- (more_eq_preds, dict_preds) = partition isEqPred theta
dict_tys = mkPredTys theta
real_arg_tys = dict_tys ++ orig_arg_tys
- real_stricts = map mk_dict_strict_mark dict_preds ++ arg_stricts
+ real_stricts = map mk_dict_strict_mark theta ++ arg_stricts
-- Representation arguments and demands
-- To do: eliminate duplication with MkId