A Haskell Code that formats a duration, given as a number of seconds, in a human-friendly way.
The Repo has one module, HumanReadable.Duration
, import it anywhere and use it's export function durationHumanReadable
or export ADT Duration
.
- durationHumanReadable :: Int -> Maybe String
- Duration :: see source
import HumanReadable.Duration ( durationHumanReadable
, Duration )
a :: Maybe String
a = durationHumanReadable 12345678
b :: String
b = show (read "12345678" :: Duration)
Have fun!🙂