rcd27
10/03/2020, 7:01 AMNothing
in this: fun <A> absurd(): (Nothing) -> A
, but not Unit
?
https://github.com/arrow-kt/Category-Theory-for-Programmers.kt/blob/master/src/main/ank/1.5-products-and-coproducts.md
Like it is written in CTfP book: "In the category of sets and functions, the initial object is the empty
set. Remember, an empty set corresponds to the Haskell type Void (there
is no corresponding type in C++) and the unique polymorphic function
from Void to any other type is called absurd"
So Nothing
in Kotlin is the initial type for everything else?stojan
10/03/2020, 8:06 AMabsurd
because you can never call it. And you can not call it because there are no instances of type Nothing. We do have a single Unit instance in Kotlinpakoito
10/03/2020, 11:12 AMfun <A> absurd(Nothing): A
raulraja
10/03/2020, 10:32 PMraulraja
10/03/2020, 10:34 PMraulraja
10/03/2020, 10:35 PM