-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Currently, amount is defined as
SplittablesBase.jl/src/amount.md
Lines 28 to 31 in e87e5b9
| (1) Any empty collection must have zero `amount`. | |
| (2) Any operation that increments `length` on collection must | |
| increments `amount`. |
So it's an upper bound of length that is monotonically increasing. Maybe this is too strict.
For example, maybe it's better to use the commented out code in
SplittablesBase.jl/src/implementations.jl
Lines 199 to 207 in e87e5b9
| function halve(xs::Iterators.Flatten) | |
| coll, = arguments(xs) | |
| left, right = halve(coll) | |
| return Iterators.flatten(left), Iterators.flatten(right) | |
| # return _flatten(left), _flatten(right) | |
| end | |
| # Is this better? | |
| # _flatten(xs) = safelength(xs) == 1 ? first(xs) : Iterators.flatten(xs) |
which is impossible with the current definition of amount. But the question is how to define a useful property.
Metadata
Metadata
Assignees
Labels
No labels