on master help sign in
Get the code compiling under GHC 6.8.3.

--HG-- extra : convert_revision : 0b8e7f007385f46bfb82778e805435d607115604

commit2d354b26509e678b562b489d47216dfd132d5925 authorBryan O'Sullivan <bos@serpentine.com> dateWed 23 Dec 2009, 17:46 (17 years ago) parentd717402
4 files changed+22−7
Data/Text.hs+5−1 Data/Text/Encoding/Error.hs+5−1 Data/Text/Lazy.hs+5−1 text.cabal+7−4
Data/Text.hs+5−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE BangPatterns, Rank2Types #-}
1+{-# LANGUAGE BangPatterns, CPP, Rank2Types #-}
22{-# OPTIONS_GHC -fno-warn-orphans #-}
33
44-- |
@@ -167,7 +167,9 @@ import Prelude (Char, Bool(..), Functor(..), Int, Maybe(..), String,
167167 Read(..), Show(..),
168168 (&&), (||), (+), (-), (.), ($), (>>), (*),
169169 div, not, return, otherwise)
170+#if defined(HAVE_DEEPSEQ)
170171import Control.DeepSeq (NFData)
172+#endif
171173import Control.Exception (assert)
172174import Data.Char (isSpace)
173175import Control.Monad (foldM)
@@ -215,7 +217,9 @@ instance Monoid Text where
215217instance IsString Text where
216218 fromString = pack
217219
220+#if defined(HAVE_DEEPSEQ)
218221instance NFData Text
222+#endif
219223
220224-- -----------------------------------------------------------------------------
221225-- * Conversion to/from 'Text'
Data/Text/Encoding/Error.hs+5−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
1+{-# LANGUAGE CPP, DeriveDataTypeable #-}
22-- |
33-- Module : Data.Text.Encoding.Error
44-- Copyright : (c) Bryan O'Sullivan 2009
@@ -35,7 +35,11 @@ module Data.Text.Encoding.Error
3535 , replace
3636 ) where
3737
38+#if __GLASGOW_HASKELL__ >= 610
3839import Control.Exception (Exception, throw)
40+#else
41+import Control.Exception.Extensible (Exception, throw)
42+#endif
3943import Data.Typeable (Typeable)
4044import Data.Word (Word8)
4145import Numeric (showHex)
Data/Text/Lazy.hs+5−1
@@ -1,5 +1,5 @@
11{-# OPTIONS_GHC -fno-warn-orphans #-}
2−{-# LANGUAGE BangPatterns #-}
2+{-# LANGUAGE BangPatterns, CPP #-}
33-- |
44-- Module : Data.Text.Lazy
55-- Copyright : (c) Bryan O'Sullivan 2009
@@ -169,7 +169,9 @@ import Prelude (Char, Bool(..), Maybe(..), String,
169169 (&&), (+), (-), (.), ($), (++),
170170 div, flip, fromIntegral, not, otherwise)
171171import qualified Prelude as P
172+#if defined(HAVE_DEEPSEQ)
172173import Control.DeepSeq (NFData(..))
174+#endif
173175import Data.Int (Int64)
174176import qualified Data.List as L
175177import Data.Char (isSpace)
@@ -208,9 +210,11 @@ instance Monoid Text where
208210instance IsString Text where
209211 fromString = pack
210212
213+#if defined(HAVE_DEEPSEQ)
211214instance NFData Text where
212215 rnf Empty = ()
213216 rnf (Chunk _ ts) = rnf ts
217+#endif
214218
215219-- | /O(n)/ Convert a 'String' into a 'Text'.
216220--
text.cabal+7−4
@@ -1,5 +1,5 @@
11name: text
2−version: 0.7
2+version: 0.7.0.1
33synopsis: An efficient packed Unicode text type
44description: An efficient packed Unicode text type.
55license: BSD3
@@ -67,11 +67,14 @@ library
6767
6868 build-depends:
6969 base < 5,
70− bytestring >= 0.9 && < 1.0,
71− deepseq >= 1.1.0.0
70+ bytestring >= 0.9 && < 1.0
7271 if impl(ghc >= 6.10)
7372 build-depends:
74− ghc-prim, base >= 4
73+ ghc-prim, base >= 4, deepseq >= 1.1.0.0
74+ cpp-options: -DHAVE_DEEPSEQ
75+ else
76+ build-depends: extensible-exceptions
77+ ghc-options: -XPatternSignatures
7578
7679 -- gather extensive profiling data for now
7780 ghc-prof-options: -auto-all