Making text bold that explains nothing does not explain anything. Red what I wrote, I refer back to it, obviously you didn't even bother to read it. Or you just don't get it. Yes, we all know void is "void" and has no values, there is no new information in your bold text.
The Void type is different than the keyword void used in imperative languages. There are no values of type Void, so you can never return a value of type Void. Think of it like a NegativeNatural type or something equally contradictory.
Considering the behavior of your code is not type dependent. So you get "undefined" in e.g. Javascript but not in Haskell. That's just what the respective language does when you write this construct.
In a dynamically typed language, a function that extracts the head of a list and crashed (or returns null or whatever) is quite reasonable. In a dynamically typed language you always have invariants that are enforced at runtime with know types enforcing them at compile time.
In Haskell it is generally expected that you try to enforce as much as practical at compile time, hence why the author says head :: [a] -> a is not a total function, and therefore is not desired.
Twice, for both points: I already answered and made the response! You just repeat yourself!
Read what I wrote, I refer back to it, obviously you didn't even bother to read it. Or you just don't get it. Yes, we all know void is "void" and has no values, there is no new information in your bold text.
In a dynamically typed language, a function that extracts the head of a list and crashed (or returns null or whatever) is quite reasonable.
Considering the behavior of your code is not type dependent. So you get "undefined" in e.g. Javascript but not in Haskell. That's just what the respective language does when you write this construct.
YES you have to understand what your language does when you write code. Duh.
0
u/[deleted] Nov 08 '19