> On Jun 22, 2016, at 10:07 AM, David Ungar via swift-users 
> <[email protected]> wrote:
> 
> I like to use the pipe operator for a functional programming style:
> 
> infix operator |> {associativity left precedence 100}
> 
> public func |>  <A, B> ( x: A, f: @noescape (A) throws -> B ) rethrows  -> B {
>     return try f(x)
> }
> 
> 
> It lets me write x |> y |> z instead of z(y(x)) which I much prefer when x is 
> a complicated expression.
> 
> The “rethrows” is great because it lets the “throwiness” of the functions 
> shine through.
> 
> In my conversion to Swift 3, though, I am missing the same thing for 
> @discardableResult.
> I would like to use the same |> operator for functions with or without 
> @discardableResults.
> Is there a @rediscardableResult annotation? Or some other way to do this?

There is nothing like this at present, you need to use the "_ =“ pattern.

-Chris

_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to