-
Notifications
You must be signed in to change notification settings - Fork 53
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
Provide a newtype wrapper? #24
Comments
If you think this is useful, but doesn't belong in this crate, that's also fine and I'm happy to implement and publish it as a separate crate, but thought it might be useful raising here first. |
I think it would make a lot of sense inside this crate, even if it ends up being opinionated in terms of how things are implemented, as long as they are well documented. |
Cool. I guess the only open question is how to choose default limits for Alternatively, if the callback is marked as |
There's probably not a good red zone that would apply universally. Perhaps it would make sense to supply some value as a defaulted const generic (when those come around?). |
I guess, although might take long time to wait for it. |
There's some support for const generics now, so this is back on the table, I guess. |
The most common case for deep recursion is when handling deeply nested recursive types, where
SomeType
has aBox<SomeType>
(or some other container) internally that can be nested really deeply, and then any standard operations that need to walk entire type, fail.Suggestion: would it be worth providing a
Stacker<T>
newtype that automatically handlesDeref
,DerefMut
,PartialEq
,PartialOrd
,Hash
,Debug
and so on and all other standard traits, but automatically checks and grows the stack before recursing?It seems that such type would magically handle most common cases without user having to write any stack-growing code.
The text was updated successfully, but these errors were encountered: