Stream: beginners

Topic: Scan over a list


view this post on Zulip Alper (Sep 03 2026 at 07:38):

I thought this would be useful. Is there an equivalent here?

https://www.uiua.org/docs/scan

(fold while keeping intermediate values)

view this post on Zulip Anton (Sep 04 2026 at 13:49):

Hi @Alper,
Can you share a specific use case?

view this post on Zulip Romain Lepert (Sep 12 2026 at 07:59):

cummulative sum for arrays/dataframes is one use case. triangular matrices is another

view this post on Zulip Anton (Sep 12 2026 at 11:54):

The function is commonly supported: Haskell scanl, Elm List.scanl, F# List.scan, Rust Iterator::scan, Python itertools.accumulate, numpy/pandas cumsum, APL/uiua \.

view this post on Zulip Anton (Sep 12 2026 at 11:54):

What should we call it?

view this post on Zulip Anton (Sep 12 2026 at 11:54):

I currently prefer accumulate

view this post on Zulip Richard Feldman (Sep 12 2026 at 12:17):

I'd like to still hold off on this one

view this post on Zulip Richard Feldman (Sep 12 2026 at 12:17):

for a builtin with a complicated type signature, I'd like the bar to be higher than "this could be useful" :smile:

view this post on Zulip Richard Feldman (Sep 12 2026 at 12:18):

I think the higher the learning curve, the higher the usefulness bar should be

view this post on Zulip Richard Feldman (Sep 12 2026 at 12:19):

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