Changes between Version 5 and Version 6 of Natural


Ignore:
Timestamp:
Mar 27, 2008 12:43:04 PM (7 years ago)
Author:
ross@…
Comment:

equivalent data type

Legend:

Unmodified
Added
Removed
Modified
  • Natural

    v5 v6  
    44 
    55So, let's add a Natural number type.  Ideally, we should also restrict the interpretation of literal numeric patterns to values of Natural, so that any unintentional use of features belonging to other numeric types can be flagged as a static error. 
     6 
     7Such a type could be presented as an optimized equivalent of an ordinary algebraic data type: 
     8{{{ 
     9data Natural = Zero | Succ !Natural 
     10}}} 
    611 
    712== Examples ==