8000 Allow free type of partition subdivisions · Issue #33 · milibopp/acacia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Allow free type of partition subdivisions #33
Open
@milibopp

Description

@milibopp

Consider the Partition trait:

pub trait Partition<T>: Sized {
    fn subdivide(&self) -> Vec<Self>;
    /* ... */
}

One could imagine impls of Partition that subdivide into another implementation of Partition. Currently this would have to be worked around by wrapping such partitions in an enum that comprises both. However the following does not compile:

pub trait Partition<T>: Sized {
    type Subdivision: Partition<T>;
    fn subdivide(&self) -> Vec<Subdivision>;
    /* ... */
}

For this to work rust-lang/rust#20551 needs to be fixed (only if such recursion is intended to be allowed, of course).

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0