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

Make InfiniInt<T> generic over Element #52

Closed
oscbyspro opened this issue Jul 28, 2024 · 1 comment
Closed

Make InfiniInt<T> generic over Element #52

oscbyspro opened this issue Jul 28, 2024 · 1 comment
Labels
brrr such code, much wow

Comments

@oscbyspro
Copy link
Owner

oscbyspro commented Jul 28, 2024

The current InfiniInt<T> is generic over a proxy type, rather than its element type, to satisfy the requirement machine:

struct InfiniInt<Source: SystemsInteger>: ArbitraryInteger {
    typealias Element =  Source.Element
}

I would prefer it being generic over its element type, but the compiler burns the world to ashes when I try. I'm unsure why:

struct InfiniInt<Element: SystemsInteger>: ArbitraryInteger { }
@oscbyspro oscbyspro added brrr such code, much wow help please send help :( labels Jul 28, 2024
@oscbyspro oscbyspro changed the title Make InfiniInt\<T\> generic over Element Make InfiniInt<T> generic over Element Jul 28, 2024
@oscbyspro
Copy link
Owner Author

oscbyspro commented Jul 31, 2024

Wow. Slava Pestov's fake protocol trick is magic ✨

@oscbyspro oscbyspro added this to the Ultimathnum 0.8.0 milestone Jul 31, 2024
@oscbyspro oscbyspro removed the help please send help :( label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brrr such code, much wow
Projects
None yet
Development

No branches or pull requests

1 participant