Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix compilation warnings with GHC 7.8

--HG--
extra : amend_source : c97948daf83af578a3f9e202d4989001d1cbb0fd
  • Loading branch information...
commit 9ff332200bf2739f13910e09e64d443110b83707 1 parent e3e6de8
@bos authored
Showing with 6 additions and 0 deletions.
  1. +4 −0 Data/Text/Format.hs
  2. +2 −0  Data/Text/Format/Int.hs
View
4 Data/Text/Format.hs
@@ -112,6 +112,7 @@ prec :: (Real a) =>
{-# RULES "prec/Double"
forall d x. prec d (x::Double) = B.build (C.toPrecision d x) #-}
prec digits = B.build . C.toPrecision digits . realToFrac
+{-# NOINLINE[0] prec #-}
-- | Render a floating point number using normal notation, with the
-- given number of decimal places.
@@ -122,6 +123,7 @@ fixed :: (Real a) =>
fixed decs = B.build . C.toFixed decs . realToFrac
{-# RULES "fixed/Double"
forall d x. fixed d (x::Double) = B.build (C.toFixed d x) #-}
+{-# NOINLINE[0] fixed #-}
-- | Render a floating point number using scientific/engineering
-- notation (e.g. @2.3e123@), with the given number of decimal places.
@@ -132,6 +134,7 @@ expt :: (Real a) =>
expt decs = B.build . C.toExponential decs . realToFrac
{-# RULES "expt/Double"
forall d x. expt d (x::Double) = B.build (C.toExponential d x) #-}
+{-# NOINLINE[0] expt #-}
-- | Render a floating point number using the smallest number of
-- digits that correctly represent it.
@@ -139,6 +142,7 @@ shortest :: (Real a) => a -> Builder
shortest = B.build . C.toShortest . realToFrac
{-# RULES "shortest/Double"
forall x. shortest (x::Double) = B.build (C.toShortest x) #-}
+{-# NOINLINE[0] shortest #-}
-- | Render an integer using hexadecimal notation. (No leading "0x"
-- is added.)
View
2  Data/Text/Format/Int.hs
@@ -57,6 +57,7 @@ decimal i
where
go n | n < 10 = digit n
| otherwise = go (n `quot` 10) <> digit (n `rem` 10)
+{-# NOINLINE[0] decimal #-}
hexadecimal :: Integral a => a -> Builder
{-# SPECIALIZE hexadecimal :: Int -> Builder #-}
@@ -76,6 +77,7 @@ hexadecimal i
where
go n | n < 16 = hexDigit n
| otherwise = go (n `quot` 16) <> hexDigit (n `rem` 16)
+{-# NOINLINE[0] hexadecimal #-}
digit :: Integral a => a -> Builder
digit n = singleton $! i2d (fromIntegral n)
Please sign in to comment.
Something went wrong with that request. Please try again.