blob: 86a0b1dae90be5549c758e50a2f07d37617bf43d (
plain)
1
2
3
4
5
6
7
8
9
10
|
{-# language MagicHash #-}
import GHC.Num.Natural
import GHC.Num.BigNat
import GHC.Exts
main = print $ map naturalCheck [0, 1, maxWord, maxWord + 1, invalid]
where
maxWord = fromIntegral (maxBound :: Word)
invalid = NB (bigNatOne void#) -- 1 would fit into the NS constructor.
|