[project @ 1997-06-05 20:29:14 by sof]
[ghc-hetmet.git] / ghc / compiler / deSugar / DsHsSyn.lhs
index d7e54ef..070b243 100644 (file)
@@ -10,12 +10,13 @@ module DsHsSyn where
 
 IMP_Ubiq()
 
-import HsSyn           ( OutPat(..), HsBinds(..), Bind(..), MonoBinds(..),
+import HsSyn           ( OutPat(..), HsBinds(..), MonoBinds(..),
                          Sig, HsExpr, GRHSsAndBinds, Match, HsLit )
-import TcHsSyn         ( SYN_IE(TypecheckedPat), SYN_IE(TypecheckedBind), 
+import TcHsSyn         ( SYN_IE(TypecheckedPat),
                          SYN_IE(TypecheckedMonoBinds) )
 
-import Id              ( idType )
+import Id              ( idType, SYN_IE(Id) )
+import Type             ( SYN_IE(Type) )
 import TysWiredIn      ( mkListTy, mkTupleTy, unitTy )
 import Util            ( panic )
 \end{code}
@@ -36,6 +37,7 @@ outPatType (TuplePat pats)    = mkTupleTy (length pats) (map outPatType pats)
 outPatType (RecPat _ ty _)      = ty
 outPatType (LitPat lit ty)     = ty
 outPatType (NPat lit ty _)     = ty
+outPatType (NPlusKPat _ _ ty _ _) = ty
 outPatType (DictPat ds ms)      = case (length ds_ms) of
                                    0 -> unitTy
                                    1 -> idType (head ds_ms)
@@ -52,11 +54,6 @@ the same order as they appear in the tuple.
 collectTypedBinders and collectedTypedPatBinders are the exportees.
 
 \begin{code}
-collectTypedBinders :: TypecheckedBind -> [Id]
-collectTypedBinders EmptyBind      = []
-collectTypedBinders (NonRecBind bs) = collectTypedMonoBinders bs
-collectTypedBinders (RecBind    bs) = collectTypedMonoBinders bs
-
 collectTypedMonoBinders :: TypecheckedMonoBinds -> [Id]
 collectTypedMonoBinders EmptyMonoBinds       = []
 collectTypedMonoBinders (PatMonoBind pat _ _) = collectTypedPatBinders pat
@@ -65,6 +62,8 @@ collectTypedMonoBinders (VarMonoBind v _)     = [v]
 collectTypedMonoBinders (CoreMonoBind v _)     = [v]
 collectTypedMonoBinders (AndMonoBinds bs1 bs2)
  = collectTypedMonoBinders bs1 ++ collectTypedMonoBinders bs2
+collectTypedMonoBinders (AbsBinds _ _ exports _)
+  = [global | (_, global, local) <- exports]
 
 collectTypedPatBinders :: TypecheckedPat -> [Id]
 collectTypedPatBinders (VarPat var)        = [var]