Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclusive Scan #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

alecloudenback
Copy link

@alecloudenback alecloudenback commented May 27, 2023

Original repo issue: JuliaFolds/Transducers.jl#366

The scanx tests pass, but locally I had other errors in test on master

Questions about the approach:

  • Currently for a vector, will return values all the way to the last element even though the usual implementation (according to Wikipedia) would exclude it. However, it seems more general to include the last element and then just combine with a DropLast transducer. Thoughts on this?
    • Admittedly, I came to this partly because I hit a roadblock at this point trying to get the iteration to stop early.
  • max and min require the init argument. I thought InitialValues.jl might define this; in the test I use typemin/typemax

Other todo:

  • Doc pages
  • ScanxEmit?

@MasonProtter
Copy link
Member

Thanks Alec,

  • Currently for a vector, will return values all the way to the last element even though the usual implementation (according to Wikipedia) would exclude it. However, it seems more general to include the last element and then just combine with a DropLast transducer. Thoughts on this?

    * Admittedly, I came to this partly because I hit a roadblock at this point trying to get the iteration to stop early.
    

This sounds fine to me so long as it's documented but I don't know how other people feel...

  • max and min require the init argument. I thought InitialValues.jl might define this; in the test I use typemin/typemax

Seems to work fine:

julia> min(InitialValue(min), 1)
1

@jariji
Copy link

jariji commented Jun 26, 2023

This sounds fine to me so long as it's documented but I don't know how other people feel

As I said on Zulip, imho think the name "exclusive scan" should be reserved for the length-preserving operation since there seems to be fairly universal agreement that's what it refers to, according to my googling. If someone can find libraries or texts using it in other ways that would lessen the strength of this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants