Open fridis opened 2 months ago
foldf is redundant with reduce, and fold* generally provides the same functionality like reduce*, so we should think of better names, e.g.,
foldf
reduce
fold*
reduce*
reduce(R type, init R, f (R,T) -> R | abort R) R
reduce_or_abort
foldf(B type, f (B,T)->B, e B)
reduce(B type, init B, f (B,T)->B)
fold1(f (T,T)->T)
reduce1(f (T,T)->T)
fold(m Monoid T)
reduce(m Monoid T)
Similarly, we need a similar set for functions for Sequence.scan.
Sequence.scan
I'm not sure about this, in most languages, fold seems to be the more general variant of reduce by taking an additional accumulator parameter.
fold
We should certainly make this more consistent though.
foldf
is redundant withreduce
, andfold*
generally provides the same functionality likereduce*
, so we should think of better names, e.g.,reduce(R type, init R, f (R,T) -> R | abort R) R
should bereduce_or_abort
foldf(B type, f (B,T)->B, e B)
should bereduce(B type, init B, f (B,T)->B)
fold1(f (T,T)->T)
should bereduce1(f (T,T)->T)
fold(m Monoid T)
should bereduce(m Monoid T)
Similarly, we need a similar set for functions for
Sequence.scan
.