Parser depends on DynFlags, depends on Hooks, depends on TcM, DsM, ...

Sebastian Graf sgraf1337 at gmail.com
Thu Sep 10 13:12:16 UTC 2020


Hey Sylvain,

In https://gitlab.haskell.org/ghc/ghc/-/merge_requests/3971 I had to fight
once more with the transitive dependency set of the parser, the minimality
of which is crucial for ghc-lib-parser
<https://hackage.haskell.org/package/ghc-lib-parser> and tested by the
CountParserDeps test.

I discovered that I need to make (parts of) `DsM` abstract, because it is
transitively imported from the Parser for example through Parser.y ->
Lexer.x -> DynFlags -> Hooks -> {DsM,TcM}.
Since you are our mastermind behind the "Tame DynFlags" initiative, I'd
like to hear your opinion on where progress can be/is made on that front.

I see there is https://gitlab.haskell.org/ghc/ghc/-/issues/10961 and
https://gitlab.haskell.org/ghc/ghc/-/issues/11301 which ask a related, but
different question: They want a DynFlags-free interface, but I even want a
DynFlags-free *module*.

Would you say it's reasonable to abstract the definition of `PState` over
the `DynFlags` type? I think it's only used for pretty-printing messages,
which is one of your specialties (the treatment of DynFlags in there, at
least).
Anyway, can you think of or perhaps point me to an existing road map on
that issue?

Thank you!
Sebastian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20200910/a9983d8d/attachment.html>


More information about the ghc-devs mailing list