[project @ 1996-04-30 17:34:02 by partain]
[ghc-hetmet.git] / ghc / compiler / deSugar / DsHsSyn.lhs
index 91601a1..8fae20c 100644 (file)
@@ -33,12 +33,15 @@ outPatType (ConPat _ ty _)  = ty
 outPatType (ConOpPat _ _ _ ty) = ty
 outPatType (ListPat ty _)      = mkListTy ty
 outPatType (TuplePat pats)     = mkTupleTy (length pats) (map outPatType pats)
+outPatType (RecPat _ ty _)      = ty
 outPatType (LitPat lit ty)     = ty
 outPatType (NPat lit ty _)     = ty
-outPatType (DictPat ds ms)      = case (length ds + length ms) of
+outPatType (DictPat ds ms)      = case (length ds_ms) of
                                    0 -> unitTy
-                                   1 -> idType (head (ds ++ ms))
-                                   n -> mkTupleTy n (map idType (ds ++ ms))
+                                   1 -> idType (head ds_ms)
+                                   n -> mkTupleTy n (map idType ds_ms)
+                                  where
+                                   ds_ms = ds ++ ms
 \end{code}
 
 
@@ -57,7 +60,7 @@ collectTypedBinders (RecBind    bs) = collectTypedMonoBinders bs
 collectTypedMonoBinders :: TypecheckedMonoBinds -> [Id]
 collectTypedMonoBinders EmptyMonoBinds       = []
 collectTypedMonoBinders (PatMonoBind pat _ _) = collectTypedPatBinders pat
-collectTypedMonoBinders (FunMonoBind f _ _)   = [f]
+collectTypedMonoBinders (FunMonoBind f _ _ _) = [f]
 collectTypedMonoBinders (VarMonoBind v _)     = [v]
 collectTypedMonoBinders (AndMonoBinds bs1 bs2)
  = collectTypedMonoBinders bs1 ++ collectTypedMonoBinders bs2
@@ -70,6 +73,7 @@ collectTypedPatBinders (ConPat _ _ pats)    = concat (map collectTypedPatBinders
 collectTypedPatBinders (ConOpPat p1 _ p2 _) = collectTypedPatBinders p1 ++ collectTypedPatBinders p2
 collectTypedPatBinders (ListPat t pats)     = concat (map collectTypedPatBinders pats)
 collectTypedPatBinders (TuplePat pats)     = concat (map collectTypedPatBinders pats)
+collectTypedPatBinders (RecPat _ _ fields)  = concat (map (\ (f,pat,_) -> collectTypedPatBinders pat) fields)
 collectTypedPatBinders (DictPat ds ms)     = ds ++ ms
 collectTypedPatBinders any_other_pat       = [ {-no binders-} ]
 \end{code}