[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:44:31 UTC 2020
cgibbard pushed to branch wip/ttg-con-pat at Glasgow Haskell Compiler / GHC
Commits:
cf9c3625 by Cale Gibbard at 2020-04-13T10:44:24-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/cf9c3625a5c2b3086b945f025ae42eb2aff757fd
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/cf9c3625a5c2b3086b945f025ae42eb2aff757fd
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/408f6701/attachment.html>
More information about the ghc-commits
mailing list