[Haskell-beginners] An unsigned int class.

derek riemer driemer.riemer at gmail.com
Fri Jul 31 15:30:35 UTC 2015


Is there anything in haskell that represents an unsigned Int class? 
namely, something bounded below at 0? If not, is it possible to define 
an Int in this way to add the bounded constraint (I can't immagine 
trying to define Int like this, there has got to be a better way that I 
haven't quite understood in my study of haskell).
data UnsignedInt = 0 | 1 | 2 | (...) for a long time doing that ... 
deriving (Show, Eq, Ord, Bounded, Read)
Thanks,
Derek


More information about the Beginners mailing list