
KwangYul Seo
Hello,
It seems there are three different ways to declare an empty type in Haskell.
http://www.haskell.org/haskellwiki/Empty_type
1) data E0 = E0
Perhaps this is a bit nit-picky, but is this truly empty? I would actually argue that the type is inhabited by precisely one element, `E0` (note that we aren't counting _|_).
2) newtype Void = Void Void
3) data Void
I'd like to know how the second trick works. Is it possible to create a new type from itself? How should I interpret this?
I'll try to answer as far as I understand it but someone please correct any mistruths below. Consider your type, newtype Void = Void Void There are only two ways we could construct a value of type `Void`, a = Void _|_ and, b = Void b However, `b` is a non-terminating recursion, making it equivalent to `a`. By this reasoning, since both of these constructions evaluate to _|_, `Void` must be empty. Cheers, - Ben