question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multi Use Functional Pipeline

See original GitHub issue

Is it possible to create a “functional pipeline” object that can can be applied to multiple sequences?

Example:

fp = pipeline \
    .map(lambda a: 5 * a) \
    .filter(lambda a: a > 20)

values_1 = fp(seq((1,2,3)))

values_2 = fp(seq((3,5,7,9)))

I think that this could help save a lot of overhead if this is run in a loop.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EntilZhacommented, Jun 20, 2017

Its probably useful to note that implementing this is probably overkill when the following would work just as well:

def fp(in)
    return seq(in).map(lambda a: 5 * a).filter(lambda a: a > 20)

# or
fp = lambda in: seq(in).map(lambda a: 5 * a).filter(lambda a: a > 20)

I haven’t seen a case where the computational load is on a loop calling a sequence, the load is usually with working on the sequence itself.

0reactions
EntilZhacommented, Sep 14, 2018

Closing due to inactivity.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multi-Function Silicone Pipe [WP-27] - $35.00
Multi -Function Silicone Pipe [WP-27] - • Silicone • 9-Hole screen bowl • Pipe with storage compartment • Glass reclaimer with jar •...
Read more >
Functional over object-oriented style for pipeline-esque code
The InferenceData object then gets parsed back into another DataFrame for multiple uses -- to generate plots, get checked into a database, ...
Read more >
Multi-Cycle Pipeline Operations - ECE UNM
Multi -Cycle Pipeline Operations. Let's add pipelining to some of these FP functional units. First we need to define the latency and the...
Read more >
The Parallel Functional Pipeline Pattern - Manning Publications
By contrast, the functional parallel pipeline combines all the stages into one, as if composing multiple functions.
Read more >
Collection Pipeline - Martin Fowler
There were various attempts to build collection pipelines using what we could in Java; after all, to an OOer, a function is merely...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found