diff options
author | Julian Leviston <julian@leviston.net> | 2019-02-05 21:47:46 +1100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2019-03-23 11:10:34 +0000 |
commit | 0277161a5af63ed3fb9cf499191b35d757d8614a (patch) | |
tree | 13bdb51bc43ee054bb46224935626bd273286d6c | |
parent | 0bc157238a1b8cb18a11121f7d47e820819417df (diff) | |
download | haskell-0277161a5af63ed3fb9cf499191b35d757d8614a.tar.gz |
Remove unneeded mkLitRational and replace single use case with LitRational application
-rw-r--r-- | compiler/basicTypes/Literal.hs | 5 | ||||
-rw-r--r-- | compiler/coreSyn/MkCore.hs | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/compiler/basicTypes/Literal.hs b/compiler/basicTypes/Literal.hs index b258d5a213..96595bb3db 100644 --- a/compiler/basicTypes/Literal.hs +++ b/compiler/basicTypes/Literal.hs @@ -20,7 +20,7 @@ module Literal , mkLitWord64, mkLitWord64Wrap , mkLitFloat, mkLitDouble , mkLitChar, mkLitString - , mkLitInteger, mkLitNatural, mkLitRational + , mkLitInteger, mkLitNatural , mkLitNumber, mkLitNumberWrap -- ** Operations on Literals @@ -448,9 +448,6 @@ mkLitString s = LitString (bytesFS $ mkFastString s) mkLitInteger :: Integer -> Type -> Literal mkLitInteger x ty = LitNumber LitNumInteger x ty -mkLitRational :: Integer -> Integer -> Type -> Literal -mkLitRational i e ty = LitRational i e ty - mkLitNatural :: Integer -> Type -> Literal mkLitNatural x ty = ASSERT2( inNaturalRange x, integer x ) (LitNumber LitNumNatural x ty) diff --git a/compiler/coreSyn/MkCore.hs b/compiler/coreSyn/MkCore.hs index 484c3b0531..ff68e23e3a 100644 --- a/compiler/coreSyn/MkCore.hs +++ b/compiler/coreSyn/MkCore.hs @@ -261,7 +261,7 @@ mkIntegerExpr i = do t <- lookupTyCon integerTyConName -- | Create a 'CoreExpr' which will evaluate to a @Rational@ with given significand and exponent mkRationalExpr :: MonadThings m => Integer -> Integer -> m CoreExpr -- Result :: Rational mkRationalExpr i e = do t <- lookupTyCon rationalTyConName - return (Lit (mkLitRational i e (mkTyConTy t))) + return (Lit (LitRational i e (mkTyConTy t))) -- | Create a 'CoreExpr' which will evaluate to the given @Natural@ mkNaturalExpr :: MonadThings m => Integer -> m CoreExpr |