Changes between Version 1 and Version 2 of TypeNats/AlternativeSingletons


Ignore:
Timestamp:
Apr 7, 2011 7:36:31 AM (4 years ago)
Author:
guest
Comment:

typo in code

Legend:

Unmodified
Added
Removed
Modified
  • TypeNats/AlternativeSingletons

    v1 v2  
    1 We use a family of singleton types to related type-level naturals to runtime values.
     1We use a family of singleton types to relate type-level naturals to runtime values.
    22
    33In our design, we chose to provide as primitive an overloaded "smart" constructor and a polymorphic elimination construct:
     
    66
    77class NatI n where
    8   nat :: NatI n
     8  nat :: Nat n
    99
    1010instance NatI 0 where nat = Nat 0
     
    1313
    1414natToInteger :: Nat n -> Integer
    15 natToInteger (Nat n) n = n
     15natToInteger (Nat n) = n
    1616}}}
    1717