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.

mapFunc (temporary name)

See original GitHub issue

pipeMulti carries on multiple iterable transformations in parallel:

const iter1 = range(10)
const iter2 = range(10)
const even = filter((n) => n % 2 === 0)
const square = map((n) => n * n)
const [evenIter1, squareIter2] = pipeMulti([even, square], [iter1, iter2])

It can be used in pipelines, leveraging fork (or tee)

const [evenIter1, squareIter2] = pipe(
  range(10),
  fork(2), // this fork return 2 items
  pipeMulti([even, square])
)

Given that often times you precede pipeMulti with “fork”, it would be nice if pipeMulti can fork automatically whenever the second argument is an iterable instead of an array.

const iter = range(10)
const even = filter((n) => n % 2 === 0)
const square = map((n) => n * n)
const [evenIter1, squareIter2] = pipeMulti([even, square], iter)

That become:

const [evenIter1, squareIter2] = pipe(
  range(10),
  pipeMulti([even, square]) // it implicitly fork(2)
)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
KSXGitHubcommented, Jan 25, 2019

I don’t think the name should reflect the implementation but rather its use.

When I compared the function to map, I didn’t think of its implementation, but rather, its “shape”.

Anyway, whatever is the name, it should not contain “pipe”, because it doesn’t look like pipe in the slightest.

0reactions
sithmelcommented, Jan 24, 2019

This will be pretty much the implementation @KSXGitHub 👍

I don’t think the name should reflect the implementation but rather its use. I’ll run the idea with my colleagues (English is not my mother tongue either)

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to map func_closure entries to variable names?
So my question is: How can I associate it with their original variable names (or at least positions in case of function arguments)?....
Read more >
Getting Started - Spark 3.3.1 Documentation
Global temporary view is tied to a system preserved database global_temp , and we must use the qualified name to refer it, e.g....
Read more >
org.apache.spark.api.java.function.MapFunction Java Examples
createOrReplaceTempView(PEOPLE); // SQL can be run over a temporary view created using DataFrames Dataset<Row> results = spark.sql("SELECT name FROM ...
Read more >
Errors writing to temporary collections during mapReduce ...
A error in map-reduce job crashes the secondary servers, and prevents the secondaries from starting again. I know what the error is in...
Read more >
Python Tutorial - Getting Started with Python and Python Basics
(In C/C++/C#/Java, you need to declare the name and type of a variable ... files_rename.py '\.txt$' '.bak' '/temp' Eg. Rename 0 to 9...
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