diff options
author | Julian Leviston <julian@leviston.net> | 2019-02-05 13:00:05 +1100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2019-03-23 11:10:34 +0000 |
commit | 04aee93b18294bdbe281d77dc2e4e36d839338dd (patch) | |
tree | 832aeab90b3d02c373ba6f6a2aea7273fe257416 | |
parent | 6bcbfe8c545975478a8e6031fb5e6317287374d1 (diff) | |
download | haskell-04aee93b18294bdbe281d77dc2e4e36d839338dd.tar.gz |
Remove unneeded mkFractionalLit
-rw-r--r-- | compiler/basicTypes/BasicTypes.hs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index af33a44dd5..16cd9afaae 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -99,7 +99,7 @@ module BasicTypes( IntegralLit(..), FractionalLit(..), FractionalExponentBase(..), negateIntegralLit, negateFractionalLit, fractionalLitNeg, - mkIntegralLit, mkFractionalLit, mkTHFractionalLit, rationalFromFractionalLit, + mkIntegralLit, mkTHFractionalLit, rationalFromFractionalLit, integralFractionalLit, SourceText(..), pprWithSourceText, @@ -1515,9 +1515,6 @@ data FractionalExponentBase | Base10 deriving (Data, Show) -mkRationalBase10 :: Integer -> Integer -> Rational -mkRationalBase10 i e = mkRationalWithExponentBase i e Base10 - mkRationalWithExponentBase :: Integer -> Integer -> FractionalExponentBase -> Rational mkRationalWithExponentBase i e feb = (i :% 1) * (eb ^^ e) where eb = case feb of Base2 -> 2 ; Base10 -> 10 @@ -1527,21 +1524,6 @@ rationalFromFractionalLit (FL _ _ i e expBase) = mkRationalWithExponentBase i e expBase rationalFromFractionalLit (THFL _ _ r) = r - -mkFractionalLit :: Integer -> Integer -> FractionalLit -mkFractionalLit i e = FL { fl_text = SourceText (show (realToFrac (mkRationalBase10 i e)::Double)) - -- Converting to a Double here may technically lose - -- precision (see #15502). We could alternatively - -- convert to a Rational for the most accuracy, but - -- it would cause Floats and Doubles to be displayed - -- strangely, so we opt not to do this. (In contrast - -- to mkIntegralLit, where we always convert to an - -- Integer for the highest accuracy.) - , fl_neg = i < 0 - , fl_signi = i - , fl_exp = e - , fl_exp_base = Base10 } - mkTHFractionalLit :: Rational -> FractionalLit mkTHFractionalLit r = THFL { thfl_text = SourceText (show (realToFrac r::Double)) -- Converting to a Double here may technically lose |