[swift-evolution] [Pitch] Flattening the function type of unapplied instance methods
Joe Groff
jgroff at apple.com
Thu Feb 25 11:13:04 CST 2016
> On Feb 24, 2016, at 8:50 PM, Chris Lattner <clattner at apple.com> wrote:
>
> None of these are really great. Since you’re advocating for it, I’m very concerned about making partially applied methods be uncurried always (#2). I have seen a *lot* of people use curried methods on classes (in particular) and this leads to some pretty elegant patterns. I’d expect any serious discussion of changing this behavior to include a survey of what people are actually using this for, and whether the end result we’d get from this change would be better or worse overall (not just in a single case).
I'm concerned about that too, but I think most of these use cases are already impeded by removing tuple argument splatting, since that makes it impossible to make a generic method transformation like `alterMethod<Receiver, Args, Ret>(method: Receiver -> Args -> Ret)`. I think these use cases can be recovered on flattened methods by explicit variadic splatting, since you could then write `alterMethod<Receiver, Args, Ret>(method: (Receiver, Args...) -> Ret)` instead.
-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160225/05153f5c/attachment.html>
More information about the swift-evolution
mailing list