Expand support for map streams
Things like .recursive() don't have support for OrdIndexedZSet which makes working with maps a lot harder
Joins also don't support producing maps
I was just thinking about the same. At the moment you have to use index or index_with to create and IndexedZSet.
Changing the API this way is easy. The only drawback is that even if the output is a Z-set (non-indexed) the join function will have to return a 2-tuple with the unit tuple () for the value.
For recursive the extra complication is that distinct is only defined for Z-sets and not for indexed Z-sets.
if you want groups to be sets - which is a reasonable choice - you could define distinct as mapping the standard distinct over all groups.
Oh, and also we won't be able to use OrdZSet as the default return type. It'd have to be OrdZSet for sets and OrdIndexedZSet for maps, which probably means we need two different methods.
if you want groups to be sets - which is a reasonable choice - you could define distinct as mapping the standard distinct over all groups.
Yes, but we'd need a separate distinct operator for that, which again means we need two implementations of recursive.
Could there be a trait "distinctable"? But maybe that doesn't help if the trait has to specify the output type.
Trouble is, Rust does not support specialization, so it would be impossible to have two implementations of that trait, one of which works for indexed Z-sets and the other for Z-sets (since Z-sets are a special case of indexed Z-sets). There are also no negative trait bounds, so you can't say "use this impl only if Val != ()".
BTW, in DD most operators output "sets". Indexed collections are created by separate operators that combine DBSP's index and trace in one call (not that we have to replicate their design).