Skip to content
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

Think about namespaces #110

Closed
treeowl opened this issue Mar 26, 2018 · 5 comments
Closed

Think about namespaces #110

treeowl opened this issue Mar 26, 2018 · 5 comments
Labels
task Something that needs to be done (not a bug fix)

Comments

@treeowl
Copy link
Collaborator

treeowl commented Mar 26, 2018

@andrewthad suggested changing the naming conventions to use the more common assumption that people will import thing other than types qualified. I think it would probably be too disruptive to do that directly. But sharing (or even copying and pasting) code among the different array implementations would be much easier in that regime. I believe there is quite a lot of code that could be shared. That suggests an alternative approach: layer primitive on top of another package, in the same repository, that uses the other convention. primitive itself would just be a thin shell over the other package.

@treeowl treeowl added the task Something that needs to be done (not a bug fix) label Mar 26, 2018
@andrewthad
Copy link
Collaborator

As an alternative, it doesn't necessarily have to be a separate package. It could just be different modules in the primitive package. This would actually be my preference.

@cartazio
Copy link
Contributor

cartazio commented Mar 27, 2018 via email

@treeowl
Copy link
Collaborator Author

treeowl commented Mar 27, 2018

@cartazio, there are a decent number of functions (largely in class instances) that are basically the same between Data.Primitive.Array and Data.Primitive.SmallArray, except for the names. I found myself copying definitions, then doing find and replace throughout their bodies. It was annoying. Have you had a chance to look at 109? I'm leaving town tomorrow evening....

@cartazio
Copy link
Contributor

cartazio commented Mar 27, 2018 via email

@cartazio
Copy link
Contributor

cartazio commented Apr 3, 2018

at least for now: lets not break / change any current naming conventions for Primitive. At least for preexisting modules

Perhaps it makes sense to relax it for newer modules, but that creates a nonuniformity in naming convention for both users and contributors.

i definitely think we have no good reason to wholesale rename all the current modules, this would accomplish nothing and needless break everything down stream with no real improvements.

So our choices are:
a) consistency but a teeny bit of extra verbiage (which allows mostly safe unqualified imports)
b) inconsistency (which also forces newer modules to be imported qualified)

After think about this for the past day or so, i remember'd we reexport everything in Data.Primitive

if we wish to continue to have this module be a good catch all for using all the data structures that Primitive provides, we must continue that slightly verbose convention despite the small cost of verbiage.

nothing precludes a wrapper package that exports stuff with the qualified names, but Primitive will not be that package.

@cartazio cartazio closed this as completed Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Something that needs to be done (not a bug fix)
Projects
None yet
Development

No branches or pull requests

3 participants