Changes between Initial Version and Version 1 of Ticket #2431


Ignore:
Timestamp:
Jul 10, 2008 10:39:59 AM (7 years ago)
Author:
simonpj
Comment:

Why is this useful? The only value of type Void is bottom.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2431

    • Property Difficulty changed from to Unknown
  • Ticket #2431 – Description

    initial v1  
    11Using -XEmptyDataDecls I can declare an (almost) empty data type.
     2{{{
    23  data Void
     4}}}
    35However, I can't use an empty case to discriminate values of the
    46empty type.
    57
    68This does not work:
     9{{{
    710  get :: Void -> a
     11}}}
    812Only the type signature, but no body. [This would be useful also
    913in other circumstances.]
     14{{{
    1015  get :: Void -> a
    1116  get v = case v of { }
     17}}}
    1218An empty case in the body.
    1319