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

HalveableInteger and DoubleableInteger #60

Open
oscbyspro opened this issue Aug 3, 2024 · 1 comment
Open

HalveableInteger and DoubleableInteger #60

oscbyspro opened this issue Aug 3, 2024 · 1 comment
Labels
addition oh, so shiny! maybe to do, or not to do?

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Aug 3, 2024

I haven't decided yet, but I think it would be nice if referring to U64 from U32, or U32 from U64, were possible in generic code too. A generic constraint could require multiple layers, if needed. I could also add conveniences like low-high accessors and initializers.

@oscbyspro oscbyspro added addition oh, so shiny! maybe to do, or not to do? labels Aug 3, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Aug 9, 2024

Hm. I bet I could make it work with just one of these. I also believe that HalveableInteger is better because the type chain eventually terminates at U8 or I8. Like, making DoubleInt halveable does not make it infinitely recursive. Having said that, I suspect that DoubleableInteger is easier to reason about as a generic constraint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition oh, so shiny! maybe to do, or not to do?
Projects
None yet
Development

No branches or pull requests

1 participant