Skip to content

Question about Zip behaviour  #285

Open

Description

@nhenin
main = (toList . zipAsyncly $ (,,) <$> s1 <*> s2 <*> s3) >>= print
    where s1 = fromFoldable [1, 2]
          s2 = fromFoldable [3, 4]
          s3 = fromFoldable [5, 6]
[(1,3,5),(2,4,6)]

I'm looking for a similar behaviour but where Zip produces a result as soon as one of the streams zipped produces an item. Like we add the last value produced of the other streams zipped with...

[(1,3,5),(1,4,5),(1,4,6),(2,4,6)] something like that for example... Tell me if my explanation is clear enough for you :-)

Activity

  1. harendra-kumar commented on Oct 10, 2019

    @harendra-kumar
    Member

    This is planned but not yet implemented. We call it zipWithLatest, it zips the elements generated by the first stream with the latest values of the other streams. We can also call it sampleOn as we can think of the first stream as a clock signal and we sample the other streams whenever we receive the clock signal.

  2. nhenin commented on Oct 11, 2019

    @nhenin
    ContributorAuthor

    Ok thank you for the information...

  3. added this to the 0.8.0 milestone on Feb 20, 2020
  4. linked a pull request that will close this issueImplement a stream sampling combinator #334on Feb 20, 2020
  5. harendra-kumar commented on Mar 4, 2021

    @harendra-kumar
    Member

    The sampleNew operation (unimplemented yet) will be used for such behavior.

  6. modified the milestones: 0.8.0, 0.8.1 on Mar 4, 2021
  7. modified the milestones: 0.8.2, 0.9.0 on Mar 4, 2022
  8. modified the milestones: 0.9.0, 0.10.0 on Oct 18, 2022
  9. modified the milestones: 0.10.0, 0.11.0 on Jul 13, 2023
  10. removed this from the 0.11.0 milestone on Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions