r/programminghorror • • 5h ago

One pipe through String, Array, and Map

Post image
0 Upvotes

7 comments sorted by

2

u/NatoBoram 4h ago

Looks like Elixir. Pipes are very cool.

13

u/monotone2k 5h ago

How is this horror? Looks like pretty standard query stuff.

0

u/Agitated-Display6382 4h ago

I dislike that map({x.value.length()}) still contains the original value. A map should just return the computed value

1

u/Elfet 4h ago

x is `Entry[string, Array[string]]` with { key, value }

How else do you map a Map{}?

0

u/Agitated-Display6382 3h ago

After map, I would expect to have only the computed value. Sort of: given f

foreach x in myArray yield return f(x)

Not: yield return (x, f(x))