Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Good point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: