Use of pipe command

In the Frequency Distribution Analysis Library there is the
pipe command.

I learned the other month or two ago that the HOF in streams are evaluated when they have to and in a pipe like fashion.

stream%20piping !

I couldn’t figure out how to use the stream keep withpipe

So I started to play around.

I found a use for it in changing:

Transform a list of names and ages into a list of names
Transform the list of names to a list of names in uppercase
withoutPipe

TO:

Transform item one of the list of names and ages to item one of the list of name in upper case


Transform item last of the list of names and ages to item last of the list of name in upper case

withPipe ![pipe|171x28]

I don’t know which is “better”.

I looked at the other blocks in Frequency Distribution Analysis Library and did not find them using pipe

Is  just a way of making composition of functions “look” or “feel” better?

pipe%20fogoh  reports 57

vs

fogoh  reports 57. (I forgot how to take a pic of a reporter reporting)

Any comments or feedback on the use of pipe will be appreciated.

shift-right-click. :~)

About pipe, yes, it's just cosmetic. Some people find nested function calls hard to read, because you have to understand that they run from the inside out. So pipe lets you reorder that. It's a pedagogic choice which to use.

I would add though, that your example with map getting the uppercase of the first item is different. When you use 2 maps, you are processing the list twice. With pipe, you processing the list once but making 2 calls for each item. Aside from the performance, I think that one is easier to tell what's going on because I can see in one step what's happening to an item, rather than having to think about the list that's really being created when you do the operation in 2 maps.

But to make up for it, you have to think harder about how and why the rings prevent the map from filling all three empty slots with each item. Different strokes...

Huh, that's true...I guess I've never thought about that much, but I tend to not use lambdas with multiple parameters unless I'm using formal params. I also think that, intuitively, the right arrow to helps separate how it works.

In this case, I'd personally find a nested function the easiest.