Ok, one last thing, then I go to sleep for today...

Basic Definition of a "Type":
I learned in university that a type is a "set of values".
When a function has a return type of R, it means that it does return a value of 
type R.

On the other hand, a @noreturn function doesn't return any value, so it doesn't 
really have a return type. The whole concept of a "bottom type" was made to 
create a model where every function can be specified as having a return type. 
This isn't really a useful concept outside of the Haskell language [1].

I like the "Basic Definition of a Type": while it does not generalize to 
non-returning functions, it includes all functions in the mathematical sense; 
it includes all functions that are meant to return a value. It includes all 
functions that terminate and that neither crash nor throw. This "basic 
definition" is the reason why we have functions at all. We don't have functions 
in order to build an academic model where we can study denotational semantics 
[2] in, and that is super-consistent. We have them to calculate things. And we 
don't calculate values of type `NoReturn` or `Nothing`.

If I haven't convinced you yet => we'll meet again when casting votes for the 
proposal (if it will ever go into formal review)

-Michael

[1] Yes, someone will find another language where it is useful too, but anyhow, 
it's not useful for Swift, Java, Obj-C or C++.
[2] https://en.wikibooks.org/wiki/Haskell/Denotational_semantics

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

Reply via email to