3 ms·
Though, that has 2 zeros, a positive and a negative one, but zero should be neither. To avoid that, you can do: data Int = Zero | NonZero Sign PositiveInt
by jolmg 7y ago
Though, that has 2 zeros, a positive and a negative one, but zero should be neither. To avoid that, you can do:
data Int = Zero | NonZero Sign PositiveInt
data PositiveInt = One | Succ PositiveInt
data Sign = Positive | Negative
- tel 7y agoGood point.