summaryrefslogtreecommitdiff
path: root/ghc/compiler/deSugar/Match.lhs
diff options
context:
space:
mode:
authorsimonpj <unknown>1999-05-18 15:05:18 +0000
committersimonpj <unknown>1999-05-18 15:05:18 +0000
commit69e14f75a4b031e489b7774914e5a176409cea78 (patch)
tree144089d677d9ab3a7c135e97dccd3bd16ce45d0a /ghc/compiler/deSugar/Match.lhs
parentc9dfd084e476b18290e964e5e5d66adf0771b9e6 (diff)
downloadhaskell-69e14f75a4b031e489b7774914e5a176409cea78.tar.gz
[project @ 1999-05-18 15:03:54 by simonpj]
RULES-NOTES
Diffstat (limited to 'ghc/compiler/deSugar/Match.lhs')
-rw-r--r--ghc/compiler/deSugar/Match.lhs16
1 files changed, 3 insertions, 13 deletions
diff --git a/ghc/compiler/deSugar/Match.lhs b/ghc/compiler/deSugar/Match.lhs
index 71e1749957..c71eb5c2f1 100644
--- a/ghc/compiler/deSugar/Match.lhs
+++ b/ghc/compiler/deSugar/Match.lhs
@@ -26,7 +26,7 @@ import Id ( idType, recordSelectorFieldLabel, Id )
import DataCon ( dataConFieldLabels, dataConArgTys )
import MatchCon ( matchConFamily )
import MatchLit ( matchLiterals )
-import PrelVals ( pAT_ERROR_ID )
+import PrelInfo ( pAT_ERROR_ID )
import Type ( isUnLiftedType, splitAlgTyConApp,
Type
)
@@ -460,22 +460,12 @@ tidy1 v (LazyPat pat) match_result
tidy1 v (RecPat data_con pat_ty tvs dicts rpats) match_result
= returnDs (ConPat data_con pat_ty tvs dicts pats, match_result)
where
- {-
- Special case to handle C{}, where C is a constructor
- that hasn't got any labelled fields - the Haskell98 report
- doesn't seem to make that constraint (not that I think it
- should).
- -- sof 5/99
- -}
- pats
- | null con_flabels = map (WildPat) con_arg_tys'
- | otherwise = map mk_pat tagged_arg_tys
+ pats = map mk_pat tagged_arg_tys
-- Boring stuff to find the arg-tys of the constructor
(_, inst_tys, _) = splitAlgTyConApp pat_ty
con_arg_tys' = dataConArgTys data_con inst_tys
- con_flabels = dataConFieldLabels data_con
- tagged_arg_tys = con_arg_tys' `zip` con_flabels
+ tagged_arg_tys = con_arg_tys' `zip` (dataConFieldLabels data_con)
-- mk_pat picks a WildPat of the appropriate type for absent fields,
-- and the specified pattern for present fields