[Git][ghc/ghc][wip/ttg-con-pat] Add comment about haddock's use of CollectPass.
cgibbard
gitlab at gitlab.haskell.org
Mon Apr 13 14:48:38 UTC 2020
cgibbard pushed to branch wip/ttg-con-pat at Glasgow Haskell Compiler / GHC
Commits:
7e3e5d90 by Cale Gibbard at 2020-04-13T10:48:19-04:00
Add comment about haddock's use of CollectPass.
- - - - -
1 changed file:
- compiler/GHC/Hs/Utils.hs
Changes:
=====================================
compiler/GHC/Hs/Utils.hs
=====================================
@@ -1161,9 +1161,12 @@ collect_pat pat bndrs = case pat of
(SplicePat _ _) -> bndrs
(XPat ext) -> collectXXPat (Proxy @p) ext bndrs
--- This class specifies how to collect variable identifiers from extension patterns in the given pass.
+-- | This class specifies how to collect variable identifiers from extension patterns in the given pass.
-- Consumers of the GHC API that define their own passes should feel free to implement instances in order
-- to make use of functions which depend on it.
+--
+-- In particular, Haddock already makes use of this, with an instance for its 'DocNameI' pass so that
+-- it can reuse the code in GHC for collecting binders.
class (XRec p Pat ~ Located (Pat p)) => CollectPass p where
collectXXPat :: Proxy p -> XXPat p -> [IdP p] -> [IdP p]
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7e3e5d90d6302996ff898fc4585a7aa162268eaf
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7e3e5d90d6302996ff898fc4585a7aa162268eaf
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200413/1f6f5f75/attachment-0001.html>
More information about the ghc-commits
mailing list