
31 Jul
2015
31 Jul
'15
3:08 p.m.
Hi, On Fri, Jul 31, 2015 at 09:30:35AM -0600, derek riemer wrote:
Is there anything in haskell that represents an unsigned Int class? namely, something bounded below at 0?
The module Data.Word provides unsigned integral types with modular arithmetic: Word (same size as Int), Word8, Word16, etc. $ ghci > import Data.Word ... > maxBound :: Word 18446744073709551615 > maxBound :: Word8 255 > maxBound :: Word32 4294967295 > 0 - 1 :: Word8 255 > maxBound + 1 :: Word8 0 Is that what you are looking for? http://hackage.haskell.org/package/base-4.8.1.0/docs/Data-Word.html David