> On Apr 18, 2016, at 4:31 PM, Dave Abrahams via swift-evolution > <[email protected] <mailto:[email protected]>> wrote: > > > on Fri Apr 15 2016, Brent Royal-Gordon <[email protected] > <mailto:[email protected]>> wrote: > >>> Given all this, I think it makes sense to go for syntactic >>> uniformity between parameter list and function types, and just >>> require parenthesis on the argument list. The types above can be >>> trivially written as: >>> >>> (Int) -> Float >>> (String) -> () >>> >>> Thoughts? >> >> While it's technically correct, I agree with John's assessment that >> this is "fussy". `T -> U` doesn't confuse people > > Do we have any data on this (in either direction)? > > Personally, it has always seemed obvious that T -> U being a function > type would be quite novel to some people, considering the number of > times I've seen in Haskell texts that (surprise!) you don't need > parentheses to invoke functions. I guess those are invocations and > we're talking about declarations here, but declaration-follows-use is a > kind of principle the language tries to uphold. > > But that's just intuition. Data would be very interesting.
Apart from intuition and confusion, parentheses are used at call sites and declarations. It seems out of line that they can be removed in types but only in one degenerate case. This goes against the Swift core design goal of consistency. -- E
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
