[ 
https://issues.apache.org/jira/browse/GROOVY-12220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King closed GROOVY-12220.
------------------------------
    Resolution: Information Provided

I'll close this for now but if you have a revised proposal given the extra 
info, please open a new issue.

> Pipeline Operator Support (possibly for groovy 6)
> -------------------------------------------------
>
>                 Key: GROOVY-12220
>                 URL: https://issues.apache.org/jira/browse/GROOVY-12220
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Aleks Tamarkin
>            Priority: Major
>
> Suggestion to add a functional pipline operator to Groovy
> Groovy already prioritized writing code left to right with awesome 
> improvements over java like `someString.toURL()` instead of `new 
> URL(someString)`
> A pipleine operator could make this even more universal
> Example implementation using xor `^`
> {code:java}
> class PipelineOperator {
>   static xor(Object self, Closure c) {
>     c(self)
>   }
> }
> class Foo { static foo(v) { v + 3 } }
> Closure example = { 
>    def x = { it ** 2 + it }
>    4 ^ x ^ { it / 2 } ^ (Foo.&foo)
> }
> use(PipelineOperator) {
>   example() // 4 -> 4 * 4 + 4 = 20 -> 20 / 2 = 10 -> 10 + 3 = 13
> }{code}
> Example in F# 
> [https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/functions/#pipelines]
> Thanks in advance for taking a look
>  



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to