From 393b820233caa00e428affc28e090b496d181664 Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel Date: Sun, 31 Aug 2014 11:40:50 +0200 Subject: Re-export Word from Prelude (re #9531) The original proposal text can be found at http://www.haskell.org/pipermail/libraries/2014-August/023491.html The proposal passed with a clear majority, and was additionally confirmed by the core libraries committee. *Compatibility Note* Only code that imports `Data.Word` for the sole purpose of using `Word` *and* requires to be `-Werror`-clean (due to `-fwarn-unused-imports`) is affected by this change. In order to write warning-free forward/backward compatible against `base`, a variant of the following CPP-based snippet can be used: -- Starting with base>4.7.0 or GHC>7.8 Prelude re-exports 'Word' -- The following is needed, if 'Word' is the *only* entity needed from Data.Word #ifdef MIN_VERSION_base # if !MIN_VERSION_base(4,7,1) import Data.Word (Word) # endif -- no cabal_macros.h -- fallback to __GLASGOW_HASKELL__ #elif __GLASGOW_HASKELL__ < 709 import Data.Word (Word) #endif This also updates the haddock submodule in order to avoid a compile warning --- testsuite/tests/numeric/should_run/T7014.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'testsuite/tests/numeric') diff --git a/testsuite/tests/numeric/should_run/T7014.hs b/testsuite/tests/numeric/should_run/T7014.hs index 82375389d7..222b33bd59 100644 --- a/testsuite/tests/numeric/should_run/T7014.hs +++ b/testsuite/tests/numeric/should_run/T7014.hs @@ -1,7 +1,11 @@ +{-# LANGUAGE CPP #-} + module Main where import Data.Bits -import Data.Word +#if __GLASGOW_HASKELL__ < 705 +import Data.Word (Word) +#endif test_and1 :: Word -> Word test_and1 x = x .&. 0 -- cgit v1.2.1