- ppr sty (FunMonoBind fun matches locn)
- = pprMatches sty (False, pprNonOp sty fun) matches
-
- ppr sty (VarMonoBind name expr)
- = ppHang (ppCat [pprNonOp sty name, ppEquals]) 4 (ppr sty expr)
-\end{code}
-
-%************************************************************************
-%* *
-\subsection{Collecting binders from @HsBinds@}
-%* *
-%************************************************************************
-
-Get all the binders in some @MonoBinds@, IN THE ORDER OF
-APPEARANCE; e.g., in:
-\begin{verbatim}
-...
-where
- (x, y) = ...
- f i j = ...
- [a, b] = ...
-\end{verbatim}
-it should return @[x, y, f, a, b]@ (remember, order important).
-
-\begin{code}
-collectTopLevelBinders :: HsBinds tyvar uvar name (InPat name) -> [name]
-collectTopLevelBinders EmptyBinds = []
-collectTopLevelBinders (SingleBind b) = collectBinders b
-collectTopLevelBinders (BindWith b _) = collectBinders b
-collectTopLevelBinders (ThenBinds b1 b2)
- = collectTopLevelBinders b1 ++ collectTopLevelBinders b2
-
-collectBinders :: Bind tyvar uvar name (InPat name) -> [name]
-collectBinders EmptyBind = []
-collectBinders (NonRecBind monobinds) = collectMonoBinders monobinds
-collectBinders (RecBind monobinds) = collectMonoBinders monobinds
-
-collectMonoBinders :: MonoBinds tyvar uvar name (InPat name) -> [name]
-collectMonoBinders EmptyMonoBinds = []
-collectMonoBinders (PatMonoBind pat grhss_w_binds _) = collectPatBinders pat
-collectMonoBinders (FunMonoBind f matches _) = [f]
-collectMonoBinders (VarMonoBind v expr) = error "collectMonoBinders"
-collectMonoBinders (AndMonoBinds bs1 bs2)
- = collectMonoBinders bs1 ++ collectMonoBinders bs2
-
--- We'd like the binders -- and where they came from --
--- so we can make new ones with equally-useful origin info.
-
-collectMonoBindersAndLocs
- :: MonoBinds tyvar uvar name (InPat name) -> [(name, SrcLoc)]
-
-collectMonoBindersAndLocs EmptyMonoBinds = []
-
-collectMonoBindersAndLocs (AndMonoBinds bs1 bs2)
- = collectMonoBindersAndLocs bs1 ++ collectMonoBindersAndLocs bs2
-
-collectMonoBindersAndLocs (PatMonoBind pat grhss_w_binds locn)
- = collectPatBinders pat `zip` repeat locn
-
-collectMonoBindersAndLocs (FunMonoBind f matches locn) = [(f, locn)]
-
-#ifdef DEBUG
-collectMonoBindersAndLocs (VarMonoBind v expr)
- = trace "collectMonoBindersAndLocs:VarMonoBind" []
- -- ToDo: this is dubious, i.e., wrong, but harmless?
-#endif