summaryrefslogtreecommitdiff
path: root/diddohs.hs
diff options
context:
space:
mode:
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