Should we make CommonState opaque or perhaps not expose it at all? #11005
jgm
started this conversation in
Development
Replies: 1 comment 3 replies
-
In general I'd be in favor of that, but I think we'll first need to provide a better interface for Lua. A quick code search on GitHub shows that there are 250 hits for Maybe we should start adding more functions to the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the (non-public) T.P.Class.CommonState exposes
CommonState(..)
, and T.P.Class exports this in the public API.I propose that we do not export the details of CommonState (and perhaps we don't need to expose CommonState at all). We have functions like
getVerbosity
that interact with CommonState, but there is no reason to expose the internals in the public API.And here is a reason against exposing them: I have just added stManager, which caches an HTTP client manager. This is something that has a purely internal use --
openURL
uses the cached Manager to avoid creating it anew on each request. If we did want to create a cabal flag that turns off network features, then this would block it as long as stManager is in the public API (given the policy that cabal flags can't alter the API).I don't think anything in pandoc itself would break if we didn't expose CommonState. pandoc-lua-engine has code that exposes CommonState externals (read-only I think) in the Lua interface; this would have to be removed. Do people depend on that?
@tarleb thoughts?
Beta Was this translation helpful? Give feedback.
All reactions