[from now] 2014/04/21 07:57:56

[36mdiff --git a/daily_data/20140418.txt b/daily_data/20140418.txt[m
[36mindex aadccc6..2b5d669 100644[m
[36m--- a/daily_data/20140418.txt[m
[36m+++ b/daily_data/20140418.txt[m
[34m@@ -1,24 +1,41 @@[m
[1m---- Meal [m
[1m-- NAME: [m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[32m     "onigiri katsuo"[m
[1m-- DATE: [m
[4m+[m[4m- DATE:[m
[32m     2014-04-18 09:19:45.5043693 JAPAN[m
[1m-- NUTRIENT: [m
[4m+[m[4m- NUTRIENT:[m
[32m     Nutrient {calorie = Just 198.0, protein = Just 4.0, fat = Just 1.1, carbon = Just 43.1}[m
[32m [m
[1m---- Meal [m
[1m-- NAME: [m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[32m     "ginshari_musubi ohba"[m
[1m-- DATE: [m
[4m+[m[4m- DATE:[m
[32m     2014-04-18 12:01:48.9569174 JAPAN[m
[1m-- NUTRIENT: [m
[4m+[m[4m- NUTRIENT:[m
[32m     Nutrient {calorie = Just 200.0, protein = Just 3.5, fat = Just 0.8, carbon = Just 44.8}[m
[32m [m
[1m---- Meal [m
[1m-- NAME: [m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[32m     "salada chiken"[m
[1m-- DATE: [m
[4m+[m[4m- DATE:[m
[32m     2014-04-18 12:07:33.6893872 JAPAN[m
[1m-- NUTRIENT: [m
[4m+[m[4m- NUTRIENT:[m
[32m     Nutrient {calorie = Just 131.25, protein = Just 29.75, fat = Just 1.125, carbon = Just 0.375}[m
[32m [m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "kellog fruit garanora"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-18 19:36:22.840599 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 172.0, protein = Just 2.2, fat = Just 4.9, carbon = Just 29.1}[m
[4m+[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "haagen dazs greentea"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-18 19:40:48.416057 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 163.0, protein = Just 3.3, fat = Just 10.1, carbon = Just 14.7}[m
[7m+[m
[7m+[m
[36mdiff --git a/daily_data/20140419.txt b/daily_data/20140419.txt[m
[36mnew file mode 100644[m
[36mindex 0000000..ef1d45f[m
[36m--- /dev/null[m
[36m+++ b/daily_data/20140419.txt[m
[34m@@ -0,0 +1,95 @@[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "kellog fruit granora"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-19 05:07:09.944508 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 344.0, protein = Just 4.4, fat = Just 9.8, carbon = Just 58.36}[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "haagen datz"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-19 06:12:07.541692 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 167.0, protein = Just 3.1, fat = Just 11.1, carbon = Just 13.6}[m
[4m+[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "granora"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-19 07:29:05.575159 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 1358.0, protein = Just 9.0, fat = Just 39.2, carbon = Just 113.02}[m
[4m+[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "potato chips"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-19 13:28:46.542073 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 332.0, protein = Just 2.6, fat = Just 20.4, carbon = Just 34.6}[m
[4m+[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "naporitan"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-19 13:37:03.081357 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 600.0, protein = Just 16.8, fat = Just 24.2, carbon = Just 78.3}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "sugar corn"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-19 13:41:49.49825 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 134.0, protein = Just 1.8, fat = Just 3.3, carbon = Just 13.9}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "sugar corn"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-19 13:56:07.477946 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 268.0, protein = Just 3.6, fat = Just 6.9, carbon = Just 27.8}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "sugar corn"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-19 14:06:22.981658 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 268.0, protein = Just 3.6, fat = Just 6.9, carbon = Just 27.8}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "granora"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-19 15:19:46.113359 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 580.5, protein = Just 7.425, fat = Just 16.5375, carbon = Just 98.2125}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "potato chips"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-20 01:17:10.134374 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 405.0, protein = Just 3.7, fat = Just 25.5, carbon = Just 40.2}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "Choco cake"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-20 01:18:03.48729 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 307.0, protein = Nothing, fat = Nothing, carbon = Nothing}[m
[4m+[m
[4m+[m[4m--- Meal[m[7m [m
[4m+[m[4m- NAME:[m[7m [m
[4m+[m[4m    "negitoro"[m
[4m+[m[4m- DATE:[m[7m [m
[4m+[m[4m    2014-04-20 01:18:53.033371 JAPAN[m
[4m+[m[4m- NUTRIENT:[m[7m [m
[4m+[m[4m    Nutrient {calorie = Just 207.0, protein = Just 6.5, fat = Just 4.1, carbon = Just 36.2}[m
[4m+[m
[36mdiff --git a/daily_data/20140420.txt b/daily_data/20140420.txt[m
[36mnew file mode 100644[m
[36mindex 0000000..de1ed42[m
[36m--- /dev/null[m
[36m+++ b/daily_data/20140420.txt[m
[34m@@ -0,0 +1,28 @@[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "domino pizza"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-20 16:45:09.056697 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 1400.0, protein = Nothing, fat = Nothing, carbon = Nothing}[m
[4m+[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "choco daifuku"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-20 20:22:15.085155 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 139.0, protein = Just 1.6, fat = Just 6.0, carbon = Just 19.6}[m
[4m+[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "kidkad maccha"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-20 20:23:47.159776 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 756.0, protein = Just 5.76, fat = Just 44.4, carbon = Just 84.0}[m
[4m+[m
[4m+[m[4m--- Wokout[m
[4m+[m[4m- Just 924.0[m
[4m+[m
[4m+[m
[36mdiff --git a/daily_data/20140421.txt b/daily_data/20140421.txt[m
[36mnew file mode 100644[m
[36mindex 0000000..5f6f097[m
[36m--- /dev/null[m
[36m+++ b/daily_data/20140421.txt[m
[34m@@ -0,0 +1,8 @@[m
[4m+[m[4m--- Meal[m
[4m+[m[4m- NAME:[m
[4m+[m[4m    "oats meal"[m
[4m+[m[4m- DATE:[m
[4m+[m[4m    2014-04-21 06:49:49.734731 JAPAN[m
[4m+[m[4m- NUTRIENT:[m
[4m+[m[4m    Nutrient {calorie = Just 340.625, protein = Just 34.046, fat = Just 14.846, carbon = Just 27.318}[m
[4m+[m
[36mdiff --git a/src/Main b/src/Main[m
[36mindex 5978798..360afc4 100755[m
Binary files a/src/Main and b/src/Main differ
[36mdiff --git a/src/Main.hs b/src/Main.hs[m
[36mindex 407b21d..b6f4f59 100644[m
[36m--- a/src/Main.hs[m
[36m+++ b/src/Main.hs[m
[34m@@ -3,7 +3,7 @@[m[32m [m[33mmodule Main where[m
[32m import qualified Meal as M[m
[32m import qualified Workout as W[m
[32m import qualified Util.Util as U[m
[1m-import qualified Util.Translate as T[m
[4m+[m[4m--import qualified Util.Translate as T[m
[32m import Data.Time[m
[32m import Control.Applicative[m
[32m import System.Environment[m
[34m@@ -31,11 +31,16 @@[m[32m [m[33mzeroFill len n = if l >= len[m
[32m [m
[32m main :: IO ()[m
[32m main = do[m
[1m-    x <- getArgs[m
[1m-    let cmd  = if length x > 0 then head x else ""[m
[32m     let windows = "C:/HOME/learning_haskell/calorie/daily_data"[m
[32m     let mac = "/Users/theatrical/learning_haskell/calorie_hs/daily_data"[m
[1m-    file <- pure (\n -> windows ++ "/" ++ n ++ ".txt") <*> filename[m
[4m+[m[4m    x <- getArgs[m
[4m+[m[4m    file <- if length x > 1 && head x == "-file" then return $ head . tail $ x[m
[4m+[m[4m                                 else pure (\n -> mac ++ "/" ++ n ++ ".txt") <*> filename[m
[4m+[m[4m    putStrLn file[m
[4m+[m[4m    let cmd  = if length x > 0 && head x /= "-file"[m
[4m+[m[4m                   then head $ x[m
[4m+[m[4m                   else if length x > 2 then head . tail .tail $ x[m
[4m+[m[4m                                        else ""[m
[32m     contents <- case cmd of[m
[32m                         "workout" -> W.insertWorkout >>= return . ("--- Wokout\n- " ++) .  show[m
[32m                         "add"     -> M.insertMeal >>= return . M.showMeal[m