3 ms·
I don't think anyone is claiming Void in Scala/Haskell/Rust is equivalent to Unit in Scala/Haskell/Rust. The question here was Unit vs empty tuple. Up-thread
by dllthomas 10y ago
I don't think anyone is claiming Void in Scala/Haskell/Rust is equivalent to Unit in Scala/Haskell/Rust.
The question here was Unit vs empty tuple.
Up-thread was the question of whether C "void" is more like S/H/R Unit or S/H/R Void.
- vertex-four 10y agoUpthread was: > If Rust follows Scala then `()` is not the empty tuple, but rather Unit (void in C*). The implication is that () == Unit == void. The empty tuple and unit are essentially equivalent aside from name, void is something else.
- dllthomas 10y agoRegardless of who is right, you are arguing the wrong bit of it. I contend that, to a person, everyone saying "C void is Unit" doesn't think C void is Void. Arguing that Void is not Unit is just completely spurious. Of course Void is not Unit. No one disagrees. In truth, C void is not exactly either Void or Unit. Like Void, you can't exactly make one... but you can call functions declared to take it and write functions that return it, and really it just means "I have no information to pass" - which is more like Unit.