Skip to content

Provide a newtype wrapper? #24

@RReverser

Description

@RReverser

The most common case for deep recursion is when handling deeply nested recursive types, where SomeType has a Box<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 handles Deref, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions