-- Parse and evaluate a string expression.
--
-- > evalStr "(2+3)*4" == Just 20
-- > evalStr "(2+3)*" == Nothing

evalStr :: String -> Maybe Integer
evalStr str =
    case parseExp ExprT.Lit ExprT.Add ExprT.Mul str of
        Just exp -> Just (eval exp)
        Nothing -> Nothing

-- Abstract the calculator operations
-- to operate on various types of data.
evalStr :: String -> Maybe Integer
evalStr str =
    case parseExp ExprT.Lit ExprT.Add ExprT.Mul str of
        Just exp -> Just (eval exp)
        Nothing -> Nothing

-- Abstract the calculator operations
-- to operate on various types of data.
evalStr str =
    case parseExp ExprT.Lit ExprT.Add ExprT.Mul str of
        Just exp -> Just (eval exp)
        Nothing -> Nothing

-- Abstract the calculator operations
-- to operate on various types of data.