summaryrefslogtreecommitdiff
path: root/diddohs.hs
diff options
context:
space:
mode:
authorHendrik Jaeger <henk@frustcomp>2014-03-11 00:21:54 +0100
committerHendrik Jaeger <henk@frustcomp>2014-03-11 00:23:04 +0100
commit1e3285599922c3b6ec009ac641464f3232d59bb8 (patch)
tree4b6c4e29f58574182f3b53e327e269d59a1ad0a2 /diddohs.hs
parent62ba998ef05a79c1fd60386f7ec8dbef49f8a78f (diff)
On branch master
modified: Diddo.hs modified: HMSTime.hs modified: diddohs.hs
Diffstat (limited to 'diddohs.hs')
-rw-r--r--diddohs.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/diddohs.hs b/diddohs.hs
index 0444e22..026ce16 100644
--- a/diddohs.hs
+++ b/diddohs.hs
@@ -1,12 +1,14 @@
import Control.Applicative( (<$>) )
import Control.Monad( unless )
-import qualified Data.Map as Map
import Data.Time.Clock( UTCTime(..) )
import Diddo( DiddoEntry(..), LogEntry(..), parseDiddoLogline, formatDiddoEntry, timestamp, logToDiddoEntry )
import System.Console.GetOpt
import System.Environment( getArgs )
import System.Exit( exitSuccess, exitFailure )
import System.IO( stderr, hPutStr )
+import qualified Data.Map as Map
+import qualified Data.Text as T
+import qualified Data.Text.IO as TIO
data Opt = Opt
{ optVerbose :: Bool
@@ -88,8 +90,8 @@ main = do
dddLogEntries <-
map Diddo.parseDiddoLogline <$> case optInputFiles effectiveOptions of
- files@(_:_) -> lines . concat <$> mapM readFile files
- [] -> lines <$> getContents
+ files@(_:_) -> T.lines . T.concat <$> mapM TIO.readFile files
+ [] -> T.lines <$> TIO.getContents
let
dddLogEntryMap = Map.fromList $ map (\diddo -> (Diddo.timestamp diddo, diddo)) dddLogEntries
@@ -101,5 +103,5 @@ main = do
mapM_ putStrLn args
-- DEBUG
- mapM_ (putStrLn . snd) $ Map.toAscList $ Map.map (Diddo.formatDiddoEntry outDateFmt) diddoEntriesMap
+ mapM_ (TIO.putStrLn . snd) $ Map.toAscList $ Map.map (Diddo.formatDiddoEntry outDateFmt) diddoEntriesMap