From 71bb78003d58b8b95abba85b505f1bc82a0311cc Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Wed, 27 Jun 2012 21:49:10 +0100 Subject: Add IntegerConversionRules Includes a test for the problem in #6111. --- .../tests/lib/integer/IntegerConversionRules.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 testsuite/tests/lib/integer/IntegerConversionRules.hs (limited to 'testsuite/tests/lib/integer/IntegerConversionRules.hs') diff --git a/testsuite/tests/lib/integer/IntegerConversionRules.hs b/testsuite/tests/lib/integer/IntegerConversionRules.hs new file mode 100644 index 0000000000..cb5269f360 --- /dev/null +++ b/testsuite/tests/lib/integer/IntegerConversionRules.hs @@ -0,0 +1,20 @@ + +module IntegerConversionRules where + +import Data.Word + +f1 :: Int -> Double +f1 = fi + +f2 :: Int -> Float +f2 = fi + +f3 :: Int -> Int +f3 = fi + +f4 :: Int -> Word +f4 = fi + +fi :: (Integral a, Num b) => a -> b +fi = fromIntegral + -- cgit v1.2.1