Fork me on GitHub
#missionary
<
2023-06-19
>
Dustin Getz16:06:02

Is there a difference between (m/relieve {} (m/reductions conj >xs)) and (m/relieve conj >xs) ?

leonoel16:06:30

yes. m/relieve doesn't accumulate and doesn't change payload type, it's only about consumption rate. (m/relieve conj >xs) is likely wrong because conj argument types are incompatible

leonoel16:06:17

m/relieve function signature should be T->T->T

Dustin Getz16:06:23

Ok, m/relieve docs say "`When upstream is faster than downstream, overflowed values are successively reduced with given function rf.`

Dustin Getz16:06:32

Is the doc correct or am I missing some nuance

leonoel16:06:24

the doc could be better

leonoel16:06:52

the values are reduced together not against an accumulator

2
Dustin Getz16:06:26

ok so + works but conj is a type error

Dustin Getz16:06:52

because (conj 1 2) on the first run

leonoel16:06:52

it would produce nested vectors, probably not what you want

leonoel16:06:32

on numbers it fails due to type error yes