[project @ 1999-07-15 09:58:23 by simonmar]
[ghc-hetmet.git] / ghc / compiler / deSugar / DsHsSyn.lhs
index 10cf88d..498ffcc 100644 (file)
@@ -15,7 +15,7 @@ import TcHsSyn                ( TypecheckedPat,
 import Id              ( idType, Id )
 import Type             ( Type )
 import TysWiredIn      ( mkListTy, mkTupleTy, mkUnboxedTupleTy, unitTy )
-import Util            ( panic )
+import Panic           ( panic )
 \end{code}
 
 Note: If @outPatType@ doesn't bear a strong resemblance to @coreExprType@,
@@ -44,33 +44,34 @@ outPatType (DictPat ds ms)      = case (length ds_ms) of
 \end{code}
 
 
-Nota bene: DsBinds relies on the fact that at least for simple
+Nota bene: @DsBinds@ relies on the fact that at least for simple
 tuple patterns @collectTypedPatBinders@ returns the binders in
 the same order as they appear in the tuple.
 
-collectTypedBinders and collectedTypedPatBinders are the exportees.
+@collectTypedBinders@ and @collectedTypedPatBinders@ are the exportees.
 
 \begin{code}
 collectTypedMonoBinders :: TypecheckedMonoBinds -> [Id]
-collectTypedMonoBinders EmptyMonoBinds       = []
-collectTypedMonoBinders (PatMonoBind pat _ _) = collectTypedPatBinders pat
-collectTypedMonoBinders (FunMonoBind f _ _ _) = [f]
-collectTypedMonoBinders (VarMonoBind v _)     = [v]
-collectTypedMonoBinders (CoreMonoBind v _)     = [v]
+collectTypedMonoBinders EmptyMonoBinds         = []
+collectTypedMonoBinders (PatMonoBind pat _ _)   = collectTypedPatBinders pat
+collectTypedMonoBinders (FunMonoBind f _ _ _)   = [f]
+collectTypedMonoBinders (VarMonoBind v _)       = [v]
+collectTypedMonoBinders (CoreMonoBind v _)      = [v]
 collectTypedMonoBinders (AndMonoBinds bs1 bs2)
  = collectTypedMonoBinders bs1 ++ collectTypedMonoBinders bs2
-collectTypedMonoBinders (AbsBinds _ _ exports _)
+collectTypedMonoBinders (AbsBinds _ _ exports _ _)
   = [global | (_, global, local) <- exports]
 
 collectTypedPatBinders :: TypecheckedPat -> [Id]
-collectTypedPatBinders (VarPat var)         = [var]
-collectTypedPatBinders (LazyPat pat)        = collectTypedPatBinders pat
-collectTypedPatBinders (AsPat a pat)        = a : collectTypedPatBinders pat
-collectTypedPatBinders (ConPat _ _ _ _ pats) = concat (map collectTypedPatBinders pats)
-collectTypedPatBinders (ListPat t pats)      = concat (map collectTypedPatBinders pats)
-collectTypedPatBinders (TuplePat pats _)     = concat (map collectTypedPatBinders pats)
+collectTypedPatBinders (VarPat var)           = [var]
+collectTypedPatBinders (LazyPat pat)          = collectTypedPatBinders pat
+collectTypedPatBinders (AsPat a pat)          = a : collectTypedPatBinders pat
+collectTypedPatBinders (ConPat _ _ _ _ pats)   = concat (map collectTypedPatBinders pats)
+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-} ]
+                                                         fields)
+collectTypedPatBinders (DictPat ds ms)        = ds ++ ms
+collectTypedPatBinders (NPlusKPat var _ _ _ _) = [var]
+collectTypedPatBinders any_other_pat          = [ {-no binders-} ]
 \end{code}