-- In reality you'd use an Either here so you could cpature the error
answer :: String -> Maybe Integer
answer eq =
    case parse parseLine "FAIL" eq of
      Right a -> Just a
      Left e  -> Nothing -- error (show e)

-- Take a line of input, and parse into a what is token, at least 1 number and 0 or more
-- operation/number pairs to perform. Then perform the ops and return the result.
-- the important trick is that we simply compose any operations together, along with 
-- the id for the first number
answer :: String -> Maybe Integer
answer eq =
    case parse parseLine "FAIL" eq of
      Right a -> Just a
      Left e  -> Nothing -- error (show e)

-- Take a line of input, and parse into a what is token, at least 1 number and 0 or more
-- operation/number pairs to perform. Then perform the ops and return the result.
-- the important trick is that we simply compose any operations together, along with 
-- the id for the first number
answer eq =
    case parse parseLine "FAIL" eq of
      Right a -> Just a
      Left e  -> Nothing -- error (show e)

-- Take a line of input, and parse into a what is token, at least 1 number and 0 or more
-- operation/number pairs to perform. Then perform the ops and return the result.
-- the important trick is that we simply compose any operations together, along with 
-- the id for the first number