Bringing up an old idea, we could rewrite `rethrows` using Never and throws type specification:
func call<T, E>(block: () throws E -> T) throws E -> T But this requires some compiler magic: non-throwing functions should effectively become functions throwing Never. - Anton 2016-06-06 1:53 GMT+03:00 Charles Srstka <[email protected]>: > On Jun 5, 2016, at 5:41 PM, Michael Peternell via swift-evolution < > [email protected]> wrote: > > > Am 05.06.2016 um 20:26 schrieb Антон Жилин via swift-evolution < > [email protected]>: > > The following names were suggested: NoReturn, Bottom, None, Never. > I would pick None, because it looks like opposite to Any and fits nicely > in generic types. > > > I would like to call the type `Void`. `Void` is a type with zero possible > values. The current `Void` would have to be renamed to `Unit`, the data > type with exactly one possible value. Less C, More Haskell :) But wait, > that's not really Haskell-ish, and it's not C-ish either. > > > That is the most confusing possible thing that this could possibly be > called. Seeing a Void return will cause anyone coming from a C, C++, ObjC, > etc. background to think of something that is definitely *not* a no-return > function. > > Charles > >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
