-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formalize ".Internal" module convention #46
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel this is somewhat ambiguous.
Foo.Internal.Bar
?Foo.InternalBar
?Both include the string
.Internal
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, perhaps appealing to the module hierarchy instead of modules names as strings would be more appropriate here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if a package is called
Internal
? Do we just say "don't do that then", or should it be a non-initial component?The way I see it, we would want both
AwesomeLibrary.Datatypes.PriorityQueue.Internal
andGHC.Internal.ByteMunging
to be considered internals, butInternal.Datatypes.List
to not be.Perhaps it's OK to just lose that namespace, though - it would be pretty confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly what's problematic with magic names.
PVP already implicitly makes a connection to cabal file syntax. So what if we we add support for "internal" modules to cabal first and then adjust PVP to reference it.
E.g.
exposed-modules
(exposed and PVP compliant)other-modules
(not exposed)internal-modules
(exposed, but exempt from PVP)This also allows easy static analysis and doesn't depend on module names.
It could be argued PVP is more general than haskell, but reading the spec carefully, that doesn't seem to be the case anyway.
The spec could also leave this open and intentionally vague and just point out that breaking changes can be exempted by a language's metadata format, specifying those modules in an appropriate format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to me to be a great thing to have done years ago. But today, we happen to have a spec that says to do one thing, and a lot of people who actually do something not quite what the spec says. Propagating a new file format to do this means convincing everyone to abandon their current practices, and move to something else, as well as waiting for the new versions of the various tools to propagate and spread.
Why not formalize what people actually do, which seems to work reasonably well in practice today?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they don't. People treat
.Internal
modules ofbytestring
ortext
as stable and under PVP. Please address that specifically. (Andservant
fwiw).EDIT: In particular I have never seen a client using
Internal
modules specifying minor version bounds. They all use wide major bounds e.g.bytestring >=0.10.3.0 && <0.12
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because that's how specs generally deteriorate and simply become documentation of current (good and bad) practices.
I'd rather work towards making the spec more general and leave space for languages and tooling to decide on non-critical things.
I also don't see any particular time pressure here. Are we in a rush?