testEnumWord32 :: IO ()
testEnumWord32 = do
     -- succ
  printTest ((succ (0::Word32)))
  printTest ((succ (minBound::Word32)))
  mayBomb   (printTest ((succ (maxBound::Word32))))

     -- pred
  printTest (pred (1::Word32))
  printTest (pred (maxBound::Word32))
  mayBomb   (printTest (pred (minBound::Word32))) 

     -- toEnum
  printTest ((map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]))
  mayBomb   (printTest ((toEnum (maxBound::Int))::Word32))

     -- fromEnum
  printTest ((map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]))
  mayBomb   (printTest (fromEnum (maxBound::Word32)))

     -- [x..] aka enumFrom
  printTest ((take 7 [(1::Word32)..]))
  printTest ((take 7 [((maxBound::Word32)-5)..])) -- just in case it doesn't catch the upper bound..
  
     -- [x,y..] aka enumFromThen
  printTest ((take 7 [(1::Word32),2..]))
  printTest ((take 7 [(1::Word32),7..]))
  printTest ((take 7 [(1::Word32),1..]))
  printTest ((take 7 [(1::Word32),0..]))
  printTest ((take 7 [(5::Word32),2..]))
  let x = (minBound::Word32) + 1
  printTest ((take 7 [x, x-1 ..]))
  let x = (minBound::Word32) + 5
  printTest ((take 7 [x, x-1 ..]))
  let x = (maxBound::Word32) - 5
  printTest ((take 7 [x, (x+1) ..]))

     -- [x..y] aka enumFromTo
  printTest ((take 7 ([(1::Word32) .. 5])))
  printTest ((take 4 ([(1::Word32) .. 1])))
  printTest ((take 7 ([(1::Word32) .. 0])))
  printTest ((take 7 ([(5::Word32) .. 0])))
  printTest ((take 7 ([(maxBound-(5::Word32)) .. maxBound])))
  printTest ((take 7 ([(minBound+(5::Word32)) .. minBound])))

     -- [x,y..z] aka enumFromThenTo
  printTest ((take 7 [(5::Word32),4..1]))
  printTest ((take 7 [(5::Word32),3..1]))
  printTest ((take 7 [(5::Word32),3..2]))
  printTest ((take 7 [(1::Word32),2..1]))
  printTest ((take 7 [(2::Word32),1..2]))
  printTest ((take 7 [(2::Word32),1..1]))
  printTest ((take 7 [(2::Word32),3..1]))

  let x = (maxBound::Word32) - 4
  printTest ((take 7 [x,(x+1)..maxBound]))
  let x = (minBound::Word32) + 5
  printTest ((take 7 [x,(x-1)..minBound]))
testEnumWord32 :: IO ()
testEnumWord32 = do
     -- succ
  printTest ((succ (0::Word32)))
  printTest ((succ (minBound::Word32)))
  mayBomb   (printTest ((succ (maxBound::Word32))))

     -- pred
  printTest (pred (1::Word32))
  printTest (pred (maxBound::Word32))
  mayBomb   (printTest (pred (minBound::Word32))) 

     -- toEnum
  printTest ((map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]))
  mayBomb   (printTest ((toEnum (maxBound::Int))::Word32))

     -- fromEnum
  printTest ((map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]))
  mayBomb   (printTest (fromEnum (maxBound::Word32)))

     -- [x..] aka enumFrom
  printTest ((take 7 [(1::Word32)..]))
  printTest ((take 7 [((maxBound::Word32)-5)..])) -- just in case it doesn't catch the upper bound..
  
     -- [x,y..] aka enumFromThen
  printTest ((take 7 [(1::Word32),2..]))
  printTest ((take 7 [(1::Word32),7..]))
  printTest ((take 7 [(1::Word32),1..]))
  printTest ((take 7 [(1::Word32),0..]))
  printTest ((take 7 [(5::Word32),2..]))
  let x = (minBound::Word32) + 1
  printTest ((take 7 [x, x-1 ..]))
  let x = (minBound::Word32) + 5
  printTest ((take 7 [x, x-1 ..]))
  let x = (maxBound::Word32) - 5
  printTest ((take 7 [x, (x+1) ..]))

     -- [x..y] aka enumFromTo
  printTest ((take 7 ([(1::Word32) .. 5])))
  printTest ((take 4 ([(1::Word32) .. 1])))
  printTest ((take 7 ([(1::Word32) .. 0])))
  printTest ((take 7 ([(5::Word32) .. 0])))
  printTest ((take 7 ([(maxBound-(5::Word32)) .. maxBound])))
  printTest ((take 7 ([(minBound+(5::Word32)) .. minBound])))

     -- [x,y..z] aka enumFromThenTo
  printTest ((take 7 [(5::Word32),4..1]))
  printTest ((take 7 [(5::Word32),3..1]))
  printTest ((take 7 [(5::Word32),3..2]))
  printTest ((take 7 [(1::Word32),2..1]))
  printTest ((take 7 [(2::Word32),1..2]))
  printTest ((take 7 [(2::Word32),1..1]))
  printTest ((take 7 [(2::Word32),3..1]))

  let x = (maxBound::Word32) - 4
  printTest ((take 7 [x,(x+1)..maxBound]))
  let x = (minBound::Word32) + 5
  printTest ((take 7 [x,(x-1)..minBound]))
testEnumWord32 = do
     -- succ
  printTest ((succ (0::Word32)))
  printTest ((succ (minBound::Word32)))
  mayBomb   (printTest ((succ (maxBound::Word32))))

     -- pred
  printTest (pred (1::Word32))
  printTest (pred (maxBound::Word32))
  mayBomb   (printTest (pred (minBound::Word32))) 

     -- toEnum
  printTest ((map (toEnum::Int->Word32) [1, fromIntegral (minBound::Word32)::Int, fromIntegral (maxBound::Int32)::Int]))
  mayBomb   (printTest ((toEnum (maxBound::Int))::Word32))

     -- fromEnum
  printTest ((map fromEnum [(1::Word32),minBound,fromIntegral (maxBound::Int)]))
  mayBomb   (printTest (fromEnum (maxBound::Word32)))

     -- [x..] aka enumFrom
  printTest ((take 7 [(1::Word32)..]))
  printTest ((take 7 [((maxBound::Word32)-5)..])) -- just in case it doesn't catch the upper bound..
  
     -- [x,y..] aka enumFromThen
  printTest ((take 7 [(1::Word32),2..]))
  printTest ((take 7 [(1::Word32),7..]))
  printTest ((take 7 [(1::Word32),1..]))
  printTest ((take 7 [(1::Word32),0..]))
  printTest ((take 7 [(5::Word32),2..]))
  let x = (minBound::Word32) + 1
  printTest ((take 7 [x, x-1 ..]))
  let x = (minBound::Word32) + 5
  printTest ((take 7 [x, x-1 ..]))
  let x = (maxBound::Word32) - 5
  printTest ((take 7 [x, (x+1) ..]))

     -- [x..y] aka enumFromTo
  printTest ((take 7 ([(1::Word32) .. 5])))
  printTest ((take 4 ([(1::Word32) .. 1])))
  printTest ((take 7 ([(1::Word32) .. 0])))
  printTest ((take 7 ([(5::Word32) .. 0])))
  printTest ((take 7 ([(maxBound-(5::Word32)) .. maxBound])))
  printTest ((take 7 ([(minBound+(5::Word32)) .. minBound])))

     -- [x,y..z] aka enumFromThenTo
  printTest ((take 7 [(5::Word32),4..1]))
  printTest ((take 7 [(5::Word32),3..1]))
  printTest ((take 7 [(5::Word32),3..2]))
  printTest ((take 7 [(1::Word32),2..1]))
  printTest ((take 7 [(2::Word32),1..2]))
  printTest ((take 7 [(2::Word32),1..1]))
  printTest ((take 7 [(2::Word32),3..1]))

  let x = (maxBound::Word32) - 4
  printTest ((take 7 [x,(x+1)..maxBound]))
  let x = (minBound::Word32) + 5
  printTest ((take 7 [x,(x-1)..minBound]))