Convert seconds to compound duration: Difference between revisions

m
→‎{{header|Haskell}}: Slight tidying of test
No edit summary
m (→‎{{header|Haskell}}: Slight tidying of test)
Line 1,619:
| otherwise = (1, rest)
 
-- TEST ------------------------------------------------------------------------
translation :: Int -> String -> String
translation secondsn local =
intercalate " -> " $ [show, timePhrase (words local)] <*> [n]
concat
[show seconds, " -> ", timePhrase ["wk", "d", "hr", "min", "sec"] seconds]
 
main :: IO ()
main =
main = mapM_ (putStrLn $. flip translation <$>"wk d hr min sec") [7259, 86400, 6000000]</lang>
{{Out}}
<pre>7259 -> 2 hr, 59 sec
9,659

edits