> On Mar 14, 2016, at 1:09 PM, Joe Groff via swift-evolution 
> <[email protected]> wrote:
> 
> Note that there's a proposal open to flatten away the currying altogether:
> 
> https://github.com/apple/swift-evolution/blob/master/proposals/0042-flatten-method-types.md
> 
> I agree that it would often be more useful to bind the non-self arguments 
> first. Maybe we could provide a different shorthand for that, though; a 
> number of people for instance have suggested `.insetBy(10.0, 10.0)` as a 
> possibility.

Interesting proposal! Is there a migration path for code that takes advantage 
of the current currying? The following is a convoluted example, but I've 
appreciated the flexibility in actual code:

  func flip<A, B, C>(input: A -> B -> C) -> B -> A -> C {
    return { b in { a in input(a)(b) } }
  }
  let insetBy = flip(CGRect.insetBy)
  let grow = { insetBy((-$0, -$0)) }
  grow(50)(.zero)


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

Reply via email to