summary refs log tree commit diff
path: root/2
diff options
context:
space:
mode:
Diffstat (limited to '2')
-rw-r--r--2/2.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/2/2.hs b/2/2.hs
index ed96a26..4437594 100644
--- a/2/2.hs
+++ b/2/2.hs
@@ -7,7 +7,7 @@ import Data.Maybe
 import qualified Data.Map as M
 import Control.Monad
 
-data Color = Red | Green | Blue deriving (Eq,Ord)
+data Color = Red | Green | Blue deriving (Show,Eq,Ord)
 type Handful = (Color, Int)
 type Set = M.Map Color Int
 type Game = (Int, [Set])
@@ -30,4 +30,4 @@ games = sepBy game newline
 solution :: Game -> Int
 solution = product . M.elems . M.unionsWith max . snd
 
-main = head <$> getArgs >>= readFile >>= print . sum . map solution . either (error.show) id . parse games ""
\ No newline at end of file
+main = head <$> getArgs >>= ((=<<) . ((print . sum . map solution . either (error . show) id) .) . parse games) <*> readFile
\ No newline at end of file