This seems to be the standard these days. () -> (), (Void) -> () are not preferred.
() -> Void
is prefered
I think this rule should follow from two other rules:
(Void)
as a closure input; just use ()
. Void
instead of ()
for closure outputs.*I do think Void
may be better as a tuple element than (). e.g.
let 茠: (Void, Int) -> Void = {_, int in}
let void: Void = 茠( (), 1 )
茠(void, 2)
I have never felt a desire to use something like this, but that doesn't mean it might not have a use, and it compiles. I like that signature better than this one:
let 茠: ( (), Int ) -> Void = {_, int in}
Added.
Most helpful comment
() -> Void
is prefered