-
Notifications
You must be signed in to change notification settings - Fork 241
Package-qualified @since
annotations
#1630
Comments
There is certainly something to be said about generalising the notion of versioning exports. My position (unless I'm presented with a very good model later) is that we start small and consider introducing a |
Being able to write For example, in |
I think I need to take the other side here. Allowing some package A to state facts about another package B—facts which can't be verified by the closure of A and its dependencies alone—creates bad coupling. |
I agree that this is suitable only with closely-coupled packages. But those close couplings exist anyway (the |
I don't see it as a reason to solidify this close coupling in yet another way. We should keep it to a minimum rather than embrace it. Close coupling is a necessary evil sometimes, but it's not necessary at all in this case if we simply add |
Even for the motivating case of the proposal (which is Another issue would be if a third-party library (say, I think that "package-qualified" is a red herring here. Imagine that the same definition is exported from different modules of the same package. Say, it was originally exported from #1629 solves both problems in the same fashion and is a much more principled approach. |
FWIW at the moment Haddock entirely ignores |
One case where this approach will likely be necessary is that of typeclass instances. Afterall, instances, unlike other declarations, cannot be named in export lists, rendering the #1629 inapplicable. However, I don't believe that this will be problematic since instances can not be hidden, rendering the @Bodigrim's concern above moot so long as there is roughly a one-to-one correspondence between internal package versions and those of the user-facing package. |
I wonder if one could simply create a grid table in the long-form module description of the downstream module. Any tightly-coupled packages that would benefit from this feature will likely have centralized release infrastructure, anyway. A tool to automate the process could be incorporated there. |
Another example of a use-case (similar but slightly distinct) is: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12479#note_563033 Here I am moving much of the internals of In these cases it would be helpful to be able to say both when they were first introduced to |
Thanks all for this discussion. It has been migrated to https://gitlab.haskell.org/ghc/ghc/-/issues/24835. :) |
Currently the
@since
annotation is used to communicate the version in which a declaration was introduced in a package. However, there is currently no story for the introduction of declarations by re-exports. For instance, imagine that we have:The documentation of
Bar
will claim thatBar.hello
has been available since 0.1; however, this is a version of packagefoo
, notbar
.In cases where
foo
andbar
are maintained together, it may make sense to be able to record the availability ofhello
frombar
in the documentation ofFoo
. For instance, you might want to write:Clearly this isn't suitable in all cases; encoding information about the exports of one package (
bar
) in another (foo
) is certainly not ideal. However, it is quite useful in cases where an declarations of a internal package are re-exported by a user-facing package.approach does have the advantage of being a simple and easily implemented generalization of the existing mechanism.
Another more general, yet harder to realize, approach can be found in #1629.
The text was updated successfully, but these errors were encountered: