-
-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Is your feature request related to a problem? Please describe.
As poly grows, more and more types will be shared between nominally unrelated packages.
For example, many packages will deal with sequences. Currently, we use the string type to represent sequences in most of the packages. However, sequences often also need to be annotated with whether they are circular or linear, as is already done in the clone package and as we are considering doing to resolve #225 :
Describe the solution you'd like
A new file (types.go) in the root of the repository that defines types commonly used across packages. Whenever it feels like you're reusing a similar struct or interface across packages, it should be placed in said file.
Describe alternatives you've considered
- Place the shared types in a package (e.g.
typesorcommon)- Pros: Will keep the top level of the package cleaner
- Cons: feels unnecessary, adds another level of indirection to package imports
- Divide up
polyinto more specific packages that share common types- Anything that deals with a sequence will be put in the package
sequence. Anything that deals with structural info will be put in the packagestructure. These packages will have a top-leveltypes.gofile that contains shared types. - Pros: Might be necessary in the future as we add more functionality anyway. Even now, the top level of the package is getting a little crowded.
- Cons: Adds another level of indirection to package imports, currently feels unnecessary as we only have sequence-based tools. Might cause import cycles for some types.
- Anything that deals with a sequence will be put in the package
- Do nothing.
- If it ain't broke, don't fix it. And it definitely ain't broke here in that it doesn't block development/use of
poly, but I still think this needs addressing.
- If it ain't broke, don't fix it. And it definitely ain't broke here in that it doesn't block development/use of