-
Notifications
You must be signed in to change notification settings - Fork 1
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
Typesafe coordinate systems #55
Comments
I would also like to see compiler warnings when using direct integer coordinates within the library to indicate a developer may encounter off-by-one errors. |
Since the CoordSystem is a number enum. Could use
Though this approach would need to be well documented and unittested as it would be easier to make a mistake. |
@charlesgregory There is I also thought given the symmetry that a lookup table would be appropriate, but again as you point out it would really be for "beauty" reasons, because the ugly repetitious code as is, is functional. |
Not sure yet how I feel about this. Could be good, could be super annoying |
Ah, you are correct. I assumed it would exist, but apparently not. |
Closed with merging of #71. |
With commit 6e93a29 I started WIP on an experimental typesafe coordinate system, building on the ideas originally in
dhtslib.faidx
(implemented because of the unusual zero-based closed coordinates used by HTSlib faidx functions)The ideas I would like to explore include
start
, andend
* I am likely not using the term Typeclass strictly correctly in comp sci terms
** coordinate systems are defined as product of zero- or one-based; half-open or closed
In my initial work, there is a disappointing amount of
static if
and repetition overall (especially when the conversions are invertible), but I don't know enough dlang type system/metaprogramming tricks to shorten it.Would like some help to write unit tests, even if it seems silly and repetitious.
The text was updated successfully, but these errors were encountered: