on master help sign in
Get the code compiling under GHC 6.8.3.
2d354b2Bryan O'Sullivan
Data/Text.hs+5−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE BangPatterns, Rank2Types #-}
1+{-# LANGUAGE BangPatterns, CPP, Rank2Types #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# OPTIONS_GHC -fno-warn-orphans #-}
3
3
4-- |
4-- |
@@ -167,7 +167,9 @@ import Prelude (Char, Bool(..), Functor(..), Int, Maybe(..), String,
167 Read(..), Show(..),
167 Read(..), Show(..),
168 (&&), (||), (+), (-), (.), ($), (>>), (*),
168 (&&), (||), (+), (-), (.), ($), (>>), (*),
169 div, not, return, otherwise)
169 div, not, return, otherwise)
170+#if defined(HAVE_DEEPSEQ)
170import Control.DeepSeq (NFData)
171import Control.DeepSeq (NFData)
172+#endif
171import Control.Exception (assert)
173import Control.Exception (assert)
172import Data.Char (isSpace)
174import Data.Char (isSpace)
173import Control.Monad (foldM)
175import Control.Monad (foldM)
@@ -215,7 +217,9 @@ instance Monoid Text where
215instance IsString Text where
217instance IsString Text where
216 fromString = pack
218 fromString = pack
217
219
220+#if defined(HAVE_DEEPSEQ)
218instance NFData Text
221instance NFData Text
222+#endif
219
223
220-- -----------------------------------------------------------------------------
224-- -----------------------------------------------------------------------------
221-- * Conversion to/from 'Text'
225-- * Conversion to/from 'Text'
Data/Text/Encoding/Error.hs+5−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
1+{-# LANGUAGE CPP, DeriveDataTypeable #-}
2-- |
2-- |
3-- Module : Data.Text.Encoding.Error
3-- Module : Data.Text.Encoding.Error
4-- Copyright : (c) Bryan O'Sullivan 2009
4-- Copyright : (c) Bryan O'Sullivan 2009
@@ -35,7 +35,11 @@ module Data.Text.Encoding.Error
35 , replace
35 , replace
36 ) where
36 ) where
37
37
38+#if __GLASGOW_HASKELL__ >= 610
38import Control.Exception (Exception, throw)
39import Control.Exception (Exception, throw)
40+#else
41+import Control.Exception.Extensible (Exception, throw)
42+#endif
39import Data.Typeable (Typeable)
43import Data.Typeable (Typeable)
40import Data.Word (Word8)
44import Data.Word (Word8)
41import Numeric (showHex)
45import Numeric (showHex)
Data/Text/Lazy.hs+5−1
@@ -1,5 +1,5 @@
1{-# OPTIONS_GHC -fno-warn-orphans #-}
1{-# OPTIONS_GHC -fno-warn-orphans #-}
2−{-# LANGUAGE BangPatterns #-}
2+{-# LANGUAGE BangPatterns, CPP #-}
3-- |
3-- |
4-- Module : Data.Text.Lazy
4-- Module : Data.Text.Lazy
5-- Copyright : (c) Bryan O'Sullivan 2009
5-- Copyright : (c) Bryan O'Sullivan 2009
@@ -169,7 +169,9 @@ import Prelude (Char, Bool(..), Maybe(..), String,
169 (&&), (+), (-), (.), ($), (++),
169 (&&), (+), (-), (.), ($), (++),
170 div, flip, fromIntegral, not, otherwise)
170 div, flip, fromIntegral, not, otherwise)
171import qualified Prelude as P
171import qualified Prelude as P
172+#if defined(HAVE_DEEPSEQ)
172import Control.DeepSeq (NFData(..))
173import Control.DeepSeq (NFData(..))
174+#endif
173import Data.Int (Int64)
175import Data.Int (Int64)
174import qualified Data.List as L
176import qualified Data.List as L
175import Data.Char (isSpace)
177import Data.Char (isSpace)
@@ -208,9 +210,11 @@ instance Monoid Text where
208instance IsString Text where
210instance IsString Text where
209 fromString = pack
211 fromString = pack
210
212
213+#if defined(HAVE_DEEPSEQ)
211instance NFData Text where
214instance NFData Text where
212 rnf Empty = ()
215 rnf Empty = ()
213 rnf (Chunk _ ts) = rnf ts
216 rnf (Chunk _ ts) = rnf ts
217+#endif
214
218
215-- | /O(n)/ Convert a 'String' into a 'Text'.
219-- | /O(n)/ Convert a 'String' into a 'Text'.
216--
220--
text.cabal+7−4
@@ -1,5 +1,5 @@
1name: text
1name: text
2−version: 0.7
2+version: 0.7.0.1
3synopsis: An efficient packed Unicode text type
3synopsis: An efficient packed Unicode text type
4description: An efficient packed Unicode text type.
4description: An efficient packed Unicode text type.
5license: BSD3
5license: BSD3
@@ -67,11 +67,14 @@ library
67
67
68 build-depends:
68 build-depends:
69 base < 5,
69 base < 5,
70− bytestring >= 0.9 && < 1.0,
70+ bytestring >= 0.9 && < 1.0
71− deepseq >= 1.1.0.0
72 if impl(ghc >= 6.10)
71 if impl(ghc >= 6.10)
73 build-depends:
72 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
75
78
76 -- gather extensive profiling data for now
79 -- gather extensive profiling data for now
77 ghc-prof-options: -auto-all
80 ghc-prof-options: -auto-all