]> git.netwichtig.de Git - user/henk/code/haskell/diddohs.git/blobdiff - diddohs.hs
On branch master
[user/henk/code/haskell/diddohs.git] / diddohs.hs
index 6baa5e9951e7f11fc0199dbf2c26624e6c9cbe74..c9ec4059c161c3178f0bcd6e8f1e25e0d7973780 100644 (file)
@@ -7,24 +7,8 @@ import Data.Monoid( mempty )
 import Data.Time.Clock( secondsToDiffTime )
 import Options.Applicative( execParser, info, strOption, long )
 import System.Environment( getArgs )
-import Text.Printf( printf )
-
-data HMSTime = HMSTime { hours :: Integer, minutes :: Integer, seconds :: Integer }
-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
-                          (h, m)     = mLeft `divMod` 60
-
-data DiddoEntry = DiddoEntry {  start :: String
-                                , finish :: String
-                                , delta :: HMSTime
-                                , entry :: String
-                             }
-instance Show DiddoEntry where
-  show (DiddoEntry start finish delta entry) = printf "%s;%s;%s;%s" start finish (show delta) entry
+import HMSTime( HMSTime(..), secondsToHMS )
+import Diddo.Entry( DiddoEntry(..) )
 
 data DiddoOpts = DiddoOpts
   { inDateFmt :: String