-- | the timeout function taking seconds instead of microseconds
timeoutSecs :: Int -> IO a -> IO (Maybe a)
timeoutSecs time = timeout $ let
  m = 1000000
  u = div maxBound m
  in if time > u then maxBound else
     if time < 1 then 100000 -- 1/10 of a second
     else m * time
timeoutSecs :: Int -> IO a -> IO (Maybe a)
timeoutSecs time = timeout $ let
  m = 1000000
  u = div maxBound m
  in if time > u then maxBound else
     if time < 1 then 100000 -- 1/10 of a second
     else m * time
timeoutSecs time = timeout $ let
  m = 1000000
  u = div maxBound m
  in if time > u then maxBound else
     if time < 1 then 100000 -- 1/10 of a second
     else m * time