I thought this would be useful. Is there an equivalent here?
https://www.uiua.org/docs/scan
(fold while keeping intermediate values)
Hi @Alper,
Can you share a specific use case?
cummulative sum for arrays/dataframes is one use case. triangular matrices is another
The function is commonly supported: Haskell scanl, Elm List.scanl, F# List.scan, Rust Iterator::scan, Python itertools.accumulate, numpy/pandas cumsum, APL/uiua \.
What should we call it?
I currently prefer accumulate
I'd like to still hold off on this one
for a builtin with a complicated type signature, I'd like the bar to be higher than "this could be useful" :smile:
I think the higher the learning curve, the higher the usefulness bar should be
I think I've used this function once in my career, and if it hadn't existed the alternatives are nearly as convenient...maybe someone else is using it all the time and would see its omission as a significant pain point, but I'd like to hear about that situation first!
Last updated: Sep 24 2026 at 15:59 UTC