[Haskell-beginners] Empty type

AntC anthony_clayden at clear.net.nz
Fri Oct 25 09:05:05 UTC 2013


> KwangYul Seo <skyul <at> company100.com> writes:
>
> It seems there are three different ways to declare an empty type in Haskell.
>
> http://www.haskell.org/haskellwiki/Empty_type
>

Hi KwangYul, it seems someone was playing games writing that page. I suggest 
you look at:

http://www.haskell.org/ghc/docs/7.6.3/html/users_guide/data-type-
extensions.html#nullary-types

So the answer is that there is one way to declare an empty type; and it's 
method 3) from your OP.

I agree with Ben that method 1) is not truly empty.

And I like both Ben's and Kim-Ee's explanations why 2) is kinda empty and 
kinda not. (Trying to use Void will almost certainly make your program loop. 
Using method 1) or 3) won't.)

AntC





More information about the Beginners mailing list