testEnumWord64 :: IO ()
testEnumWord64 = do
     -- succ
  printTest ((succ (0::Word64)))
  printTest ((succ (minBound::Word64)))
  mayBomb   (printTest ((succ (maxBound::Word64))))

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

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

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

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

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

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

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

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


--
--
--  Utils
--
--
testEnumWord64 :: IO ()
testEnumWord64 = do
     -- succ
  printTest ((succ (0::Word64)))
  printTest ((succ (minBound::Word64)))
  mayBomb   (printTest ((succ (maxBound::Word64))))

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

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

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

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

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

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

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

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


--
--
--  Utils
--
--
testEnumWord64 = do
     -- succ
  printTest ((succ (0::Word64)))
  printTest ((succ (minBound::Word64)))
  mayBomb   (printTest ((succ (maxBound::Word64))))

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

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

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

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

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

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

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

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


--
--
--  Utils
--
--