add reduce operator
See original GitHub issuehello Guys !
the idea to add another structure to simplify code execution for example:
# is the same 1+2+3+4+5+6+7+8+9+10
PS > :[+] 1..10
55
# use all arithmetic operator and possibility to store in variable
PS > $result = :[-] 10,32,54
PS > $result
# possibility to add personal reduce filter
PS > filter MyPersonalFilterToListAllWordBeginningByLetterh {
if($_.tostring().StartsWith('h')) {
$_
}
}
PS> :[:MyPersonalFilterToListAllWordBeginningByLetterh] @( 'hello','lol','test','fooooo' )
hello
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
reduce() in Python
The reduce(fun,seq) function is used to apply a particular function passed in its argument to all of the list elements mentioned in the...
Read more >Python's reduce(): From Functional to Pythonic Style
The idea behind Python's reduce() is to take an existing function, apply it cumulatively to all the items in an iterable, and generate...
Read more >Array.prototype.reduce() - JavaScript - MDN Web Docs
The reducer walks through the array element-by-element, at each step adding the current array value to the result from the previous step (this ......
Read more >How to use Reduce() Function in Python
The above python program first calculates the sum of a given list of numbers named dummy using function operator.add that calculates the sum...
Read more >Reduction operator
In computer science, the reduction operator is a type of operator that is commonly used in parallel programming to reduce the elements of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this has already been discussed in https://github.com/PowerShell/PowerShell/issues/8098 too. See that issue for some definitions of functions that work like the proposed operator.
We already have questions to add support for LINQ and extension methods which is more promising.