calculator 0.1.4.0 → 0.1.4.1
raw patch · 2 files changed
+6/−3 lines, 2 files
Files
- calculator.cabal +1/−1
- src/Calculator/Parser/Expr.hs +5/−2
calculator.cabal view
@@ -1,5 +1,5 @@ name: calculator-version: 0.1.4.0+version: 0.1.4.1 synopsis: A calculator that operates on string inputs description: A calculator repl that processes mathematical expressions. Does basic arithmetic, and provides pre-defined basic mathematical functions.
src/Calculator/Parser/Expr.hs view
@@ -81,9 +81,12 @@ parseCall :: Parser Expr parseCall = do- ident <- try (parseId <* char '(')+ ident <- optionMaybe parseId+ _ <- char '(' expr <- parseExpr _ <- char ')'- return $ Function ident expr+ return $ case ident of+ Nothing -> expr+ Just s -> Function s expr --------------------------------------------------------------------------------