main ::  IO ()
main = do
  input <- getArgs
  case partitionEithers $ map readEither input of
    ([], []) -> putStrLn "sleep: missing operand"
    ([], ts) -> threadDelay $ sum ts * 1000000
    (es,  _) -> forM_ es $ printf "sleep: invalid time interval '%s'\n"
  where readEither s = maybe (Left s) Right $ readMaybe s
main ::  IO ()
main = do
  input <- getArgs
  case partitionEithers $ map readEither input of
    ([], []) -> putStrLn "sleep: missing operand"
    ([], ts) -> threadDelay $ sum ts * 1000000
    (es,  _) -> forM_ es $ printf "sleep: invalid time interval '%s'\n"
  where readEither s = maybe (Left s) Right $ readMaybe s
main = do
  input <- getArgs
  case partitionEithers $ map readEither input of
    ([], []) -> putStrLn "sleep: missing operand"
    ([], ts) -> threadDelay $ sum ts * 1000000
    (es,  _) -> forM_ es $ printf "sleep: invalid time interval '%s'\n"
  where readEither s = maybe (Left s) Right $ readMaybe s