Skip to content

Conversation

@Daniel-Aaron-Bloom
Copy link
Contributor

@Daniel-Aaron-Bloom Daniel-Aaron-Bloom commented Mar 29, 2024

These traits make it really easy and readable to do a bunch of sums or products, especially on generics:

fn foo<A, B, C, D>(_: FoldSum::<tarr![A, B, C, D]>)
where tarr![A, B, C, D]: FoldAdd {
    /*...*/
}

Compared to:

fn foo<A, B, C, D>(_: Sum<Sum<Sum<A, B>, C>, D>)
where A: Add<B>,
    Sum<A, B>: Add<C>,
    Sum<Sum<A, B>, C>: Add<D> {
    /*...*/
}

@paholg paholg merged commit e5dffdd into paholg:main Feb 18, 2025
26 checks passed
@Daniel-Aaron-Bloom Daniel-Aaron-Bloom deleted the array-fold branch May 23, 2025 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants