Skip to content

Composable generic way to achieve n-ary zips of arrays #120

Closed
@bluss

Description

@bluss

Just brainstorming

A "builder pattern" approach may be viable here to allow n-ary zipping operations. We could even allow masking (?) which is a very valuable operation.

zip_mut(&mut a).zip(&b).zip_mut(&mut c).apply(|x, y, z| *x = *y + *z);

// This is intended to do the same as this would in numpy
// mask = c > d;
// a[mask] = b[mask]
zip_mut(&mut a).zip(&b).mask(&c, &d, <_>::gt).apply(|aelt, belt| *aelt = *belt);

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