From a443679a206ca4e12810c16576d953f7ca8ef4ac Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Wed, 27 Jan 2010 01:02:26 -0500 Subject: [PATCH] floating: Use bang patterns for unlifted bindings. GHC 6.12 complains very loudly if we do not have these, and claims that it will be an error to omit them in 6.14. --- Data/Floating/Double.hs | 2 +- Data/Floating/Float.hs | 2 +- Data/Floating/Types.hs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Data/Floating/Double.hs b/Data/Floating/Double.hs index 2a619a8..54e32a2 100644 --- a/Data/Floating/Double.hs +++ b/Data/Floating/Double.hs @@ -104,7 +104,7 @@ dropFrac (D# x) | e >= 0 = s * 2^e | otherwise = quot s (2^(negate e)) where - (# s, e# #) = decodeDoubleInteger x + !(# s, e# #) = decodeDoubleInteger x e = I# e# instance Roundable Double where diff --git a/Data/Floating/Float.hs b/Data/Floating/Float.hs index a80de6a..da44665 100644 --- a/Data/Floating/Float.hs +++ b/Data/Floating/Float.hs @@ -100,7 +100,7 @@ dropFrac (F# x) | e >= 0 = s * 2^e | otherwise = quot s (2^(negate e)) where - (# s, e# #) = decodeFloatInteger x + !(# s, e# #) = decodeFloatInteger x e = I# e# instance Roundable Float where diff --git a/Data/Floating/Types.hs b/Data/Floating/Types.hs index ce63c8a..e38b7a7 100644 --- a/Data/Floating/Types.hs +++ b/Data/Floating/Types.hs @@ -76,13 +76,13 @@ instance FloatConvert Integer Float where instance Real a => FloatConvert a Double where toFloating x = D# (num /## denom) where - D# num = toFloating . numerator . toRational $ x - D# denom = toFloating . denominator . toRational $ x + !(D# num) = toFloating . numerator . toRational $ x + !(D# denom) = toFloating . denominator . toRational $ x instance Real a => FloatConvert a Float where toFloating x = F# (divideFloat# num denom) where - F# num = toFloating . numerator . toRational $ x - F# denom = toFloating . denominator . toRational $ x + !(F# num) = toFloating . numerator . toRational $ x + !(F# denom) = toFloating . denominator . toRational $ x instance FloatConvert a a where toFloating = id -- 2.11.4.GIT