https://www.seas.upenn.edu/~sweirich/papers/fckinds.pdf
https://www.reddit.com/r/haskell/comments/4180k3/what_is_typ...
https://www.reddit.com/r/haskell/comments/4180k3/what_is_typ...
Comment here: https://lobste.rs/s/ovebeq/pythonista_s_review_haskell#c_gz0...
(That is, the dynamic-or-static choice is a product type, not a sum type!)
Not really. "Dynamic type" just means an object that carries around a description of its structure (or more commonly, a pointer to a description). You can do the same thing in many languages with static types. (Including Haskell. GHC has special support for this pattern.)
Alternatively, you can just define a recursive sum type expressing all the possible runtime types of the dynamic expression. In Aeson for example there is a type which can encode any value which might be found in a JSON file, which is basically everything you can express in Javascript apart from function closures. This doesn't require any special support from GHC and works well in most statically-typed languages.
i.e. Haskell includes the unit type ()
Bob Harper uses "unitype" which is a pretty strong argument for the name's validity
There is no "undefined" value in pure Haskell. There are expressions that have no value, due to a runtime exception (error, undefined, division by zero, memory allocation failure) or non-termination (unbounded recursion). Either way, evaluating the expression does not produce a value for the remainder of the program to operate on—you can't write a (pure) program like `if isUndefined expr then x else y` since—assuming isUndefined is a pure function and doesn't ignore its argument—the whole program is undefined if expr is undefined.
type(type) is type
evaluates to True. And that is not permitted in mathematical type theory that the Curry-Howard correspondence applies to.