From c4a5198f3330b4293c14d4ff2801475ef58ba43a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 24 Feb 2016 00:36:55 +0000 Subject: Fixed constraints of pPrint --- rpn.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpn.hs b/rpn.hs index 68c0831..ff7dd6c 100755 --- a/rpn.hs +++ b/rpn.hs @@ -40,7 +40,7 @@ fromSymbol (Number x d) = (x, d) fromSymbol _ = (0, 0) -pPrint :: Show a => Symbol a -> String +pPrint :: (Show a, Fractional a) => Symbol a -> String pPrint (Number x d) = (show x) ++ " ± " ++ (show d) ++ " (relative error: " ++ (show $ d / x) ++ ")" pPrint s = show s -- cgit v1.2.3