Fix typo in 2020 day 18

This commit is contained in:
Xavier Morel
2020-12-19 16:18:59 +01:00
parent e6e1f6c53f
commit 1fff15175c

View File

@@ -19,7 +19,7 @@ evaluate input = fst $ foldl doOp (0, "") input
doOp (res, "+") c = (res + (read c), "") doOp (res, "+") c = (res + (read c), "")
doOp (res, "*") c = (res * (read c), "") doOp (res, "*") c = (res * (read c), "")
doOp (res, "") c = (res, c) doOp (res, "") c = (res, c)
doOp e c = error ("Invalid fold on " ++ show (e,c) ++ " in " ++ input) doOp e c = error ("Invalid fold on " ++ show (e,c) ++ " in " ++ show input)
-- Evaluate an expression (for part 2) by doing +'s first then calling P1 evaluate function -- Evaluate an expression (for part 2) by doing +'s first then calling P1 evaluate function
evaluateP2 :: [String] -> Int evaluateP2 :: [String] -> Int