From d4200e02c5cf3af38d42e7a62bf83284602f648e Mon Sep 17 00:00:00 2001 From: Richard Marko Date: Wed, 15 Nov 2023 21:36:22 +0100 Subject: [PATCH] Fix testsuite warnings (#3) --- test/Test.hs | 10 ++++++---- test/TestUtils.hs | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/Test.hs b/test/Test.hs index 6e53876..3c5d3da 100644 --- a/test/Test.hs +++ b/test/Test.hs @@ -1,4 +1,5 @@ {-# LANGUAGE BangPatterns #-} +{-# LANGUAGE ScopedTypeVariables #-} module Main where import TestUtils @@ -30,7 +31,8 @@ debug = False {-# SPECIALIZE testCoercion :: (Float, Word32) -> IO () #-} {-# SPECIALIZE testCoercion :: (Double, Word64) -> IO () #-} testCoercion - :: ( Show f + :: forall f w m + . ( Show f , Show w , Integral w , RealFloat f @@ -40,9 +42,9 @@ testCoercion => (f, w) -> m () testCoercion (f, w) = do - let w' = coerceToWord f - f' = coerceToFloat w - w'' = coerceToWord f' + let w' = (coerceToWord :: f -> w) f + f' = (coerceToFloat :: w -> f) w + w'' = (coerceToWord :: f -> w) f' unless (w' == w) $ failTest (show f) (showW w) (showW w') unless (f' `eqFloat` f) $ failTest (showW w) (show f) (show f') unless (w'' == w) $ failTest (show f') (showW w) (showW w'') diff --git a/test/TestUtils.hs b/test/TestUtils.hs index 23f9fa9..f265e43 100644 --- a/test/TestUtils.hs +++ b/test/TestUtils.hs @@ -2,7 +2,6 @@ module TestUtils where import Data.Word -import Data.Bits import Numeric