summaryrefslogtreecommitdiff
path: root/libraries/base/tests/isValidNatural.hs
blob: 4c9422f05410deecd7d675df45c01944822fb1ca (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.