From b64271013b083b247d975dafbc9e402f45057de7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 22 Feb 2016 14:44:52 +0000 Subject: =?UTF-8?q?Alternate=20form=20of=20=C2=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rpn.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 rpn.hs diff --git a/rpn.hs b/rpn.hs old mode 100644 new mode 100755 index 5c75fcf..dbb0f1f --- a/rpn.hs +++ b/rpn.hs @@ -67,7 +67,7 @@ clarifySymbol s = do isKnownSymbol :: String -> Bool isKnownSymbol s = or [ - s `elem` ["+", "-", "*", "/", "±", "e"], + s `elem` ["+", "-", "*", "/", "±", "pm", "e"], isJust $ (maybeRead s :: Maybe Double) ] @@ -85,6 +85,7 @@ interpreteSymbol "-" = Sub interpreteSymbol "*" = Mult interpreteSymbol "/" = Div interpreteSymbol "±" = Unc +interpreteSymbol "+-" = Unc interpreteSymbol "e" = Exp interpreteSymbol x = Number (read x) 0 -- cgit v1.2.3