testEnumWord8 :: IO ()
testEnumWord8 = do
     -- succ
  printTest ((succ (0::Word8)))
  printTest ((succ (minBound::Word8)))
  mayBomb   (printTest ((succ (maxBound::Word8))))

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

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

     -- fromEnum
  printTest ((map fromEnum [(1::Word8),minBound,maxBound]))

     -- [x..] aka enumFrom
  printTest ((take 7 [(1::Word8)..]))
  printTest ((take 7 [((maxBound::Word8)-5)..])) -- just in case it doesn't catch the upper bound..

     -- [x,y..] aka enumFromThen
  printTest ((take 7 [(1::Word8),2..]))
  printTest ((take 7 [(1::Word8),7..]))
  printTest ((take 7 [(1::Word8),1..]))
  printTest ((take 7 [(1::Word8),0..]))
  printTest ((take 7 [(5::Word8),2..]))
  let x = (minBound::Word8) + 1
  printTest ((take 7 [x, x-1 ..]))
  let x = (minBound::Word8) + 5
  printTest ((take 7 [x, x-1 ..]))
  let x = (maxBound::Word8) - 5
  printTest ((take 7 [x, (x+1) ..]))

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

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

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

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

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

     -- fromEnum
  printTest ((map fromEnum [(1::Word8),minBound,maxBound]))

     -- [x..] aka enumFrom
  printTest ((take 7 [(1::Word8)..]))
  printTest ((take 7 [((maxBound::Word8)-5)..])) -- just in case it doesn't catch the upper bound..

     -- [x,y..] aka enumFromThen
  printTest ((take 7 [(1::Word8),2..]))
  printTest ((take 7 [(1::Word8),7..]))
  printTest ((take 7 [(1::Word8),1..]))
  printTest ((take 7 [(1::Word8),0..]))
  printTest ((take 7 [(5::Word8),2..]))
  let x = (minBound::Word8) + 1
  printTest ((take 7 [x, x-1 ..]))
  let x = (minBound::Word8) + 5
  printTest ((take 7 [x, x-1 ..]))
  let x = (maxBound::Word8) - 5
  printTest ((take 7 [x, (x+1) ..]))

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

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

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

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

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

     -- fromEnum
  printTest ((map fromEnum [(1::Word8),minBound,maxBound]))

     -- [x..] aka enumFrom
  printTest ((take 7 [(1::Word8)..]))
  printTest ((take 7 [((maxBound::Word8)-5)..])) -- just in case it doesn't catch the upper bound..

     -- [x,y..] aka enumFromThen
  printTest ((take 7 [(1::Word8),2..]))
  printTest ((take 7 [(1::Word8),7..]))
  printTest ((take 7 [(1::Word8),1..]))
  printTest ((take 7 [(1::Word8),0..]))
  printTest ((take 7 [(5::Word8),2..]))
  let x = (minBound::Word8) + 1
  printTest ((take 7 [x, x-1 ..]))
  let x = (minBound::Word8) + 5
  printTest ((take 7 [x, x-1 ..]))
  let x = (maxBound::Word8) - 5
  printTest ((take 7 [x, (x+1) ..]))

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

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

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