TimelyDataflow / TimelyDataflow/timely-dataflow

Add a FilterMap operator

Open
#355 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.6k
Forks
293
Avg merge
14h 46m
Merged PRs (30d)
4

Description

This'd be a nice ergonomic tweak, an operator in the style of Iterator::filter_map() would be really great. Currently there's a somewhat strange workaround using .flat_map(), e.g.

stream.flat_map(|foo| {
    if foo.bar() {
        Some(foo.baz)
    } else {
        None
    }
})

and while this would functionally be nearly identical, the FilterMap operator could likely specialize somewhat since it only has to handle a single output value

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing flat_map operator and comparing its behavior with Rust's Iterator::filter_map(), which is the requested model. The work is done when a FilterMap operator provides the same single-output filtering behavior as the flat_map workaround while allowing the proposed specialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.