diff options
author | Hendrik Jaeger <henk@frustcomp> | 2014-02-02 23:14:41 +0100 |
---|---|---|
committer | Hendrik Jaeger <henk@frustcomp> | 2014-02-02 23:14:41 +0100 |
commit | 84282f6317c0c1249c009469f75916acc69c1571 (patch) | |
tree | 0ab46a64cbf59225c4b00dc1011e5a409cef4202 /HMSTime.hs | |
parent | 9d103749a11f458b8e6834faf37b955fc2818c2b (diff) |
On branch master
modified: Diddo/Entry.hs
modified: HMSTime.hs
modified: diddohs.hs
* CHANGED: mainly cleanup and some experimentation
Diffstat (limited to 'HMSTime.hs')
-rw-r--r-- | HMSTime.hs | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -14,8 +14,8 @@ instance Show HMSTime where show (HMSTime h m s) = printf "%d:%02d:%02d" h m s secondsToHMS :: Integer -> HMSTime -secondsToHMS seconds = HMSTime h m s where - (mLeft, s) = seconds `divMod` 60 +secondsToHMS numSeconds = HMSTime h m s where + (mLeft, s) = numSeconds `divMod` 60 (h, m) = mLeft `divMod` 60 hmsTimeStringToHMSTime :: String -> HMSTime @@ -28,9 +28,6 @@ hmsTimeToSeconds (HMSTime {hours = h, minutes = m, seconds = s}) = h*3600 + m*60 hmsTimeStringToSeconds :: String -> Integer hmsTimeStringToSeconds = hmsTimeToSeconds . hmsTimeStringToHMSTime -hmsIntsToSeconds :: [Int] -> Int -hmsIntsToSeconds (h:m:s:_) = (3600*h + 60*m + s) - readInteger :: String -> Integer readInteger x = read x :: Integer |