diff --git a/src/Data/MathExpr.hs b/src/Data/MathExpr.hs index 99f061a..84ddaf5 100644 --- a/src/Data/MathExpr.hs +++ b/src/Data/MathExpr.hs @@ -81,6 +81,7 @@ module Data.MathExpr -- negative numbers come in the form ["num", "-"] helper [] [o] = read o helper [n, "-"] [] = negate . read $ n + helper ["-"] [n] = negate . read $ n helper (c:cs) os | c == "-" && length os < 2 = let result :: Double = negate . read . head $ cs