|
|
|
|
|
by icen
1707 days ago
|
|
The original description is misleading, yes. The distinguishing between arities is a consistent feature of all of these languages. I find fluency comes quickly to it. Edit: as for intuition between the two, this is sometimes not obvious, but I think it's a sensible generalisation from the monadic case to the dyadic. How else would you want to extend a fold to two arguments? |
|
I don't know that there is one that's useful, but a cartesian product seems like the opposite: a fold is a dimensional reduction (from 1 to 0 at the most basic), a cartesian product is dimensionally preserving (you start with 1 and 1, you end up with 2).
A cartesian product (with a mapping function) might be interpreted as the extension of a map, I don't rightly see how it can be interpreted as the extension of a fold, except in the sense that you can implement essentially any iterative process using folds, but that leads to you every n-dimensional transformation being a possible extension of a fold.
So my answer would mostly be "you would not". You could also define an n-dimensional fold as a fold against a caller-specified dimension, but I don't know how useful that would be (though I guess this sort of folds is used when integrating over time in e.g. reactive interfaces).