Permalink
Browse files

Get the code compiling under GHC 6.8.3.

--HG--
extra : convert_revision : 0b8e7f007385f46bfb82778e805435d607115604
  • Loading branch information...
1 parent d717402 commit 2d354b26509e678b562b489d47216dfd132d5925 @bos committed Dec 23, 2009
Showing with 22 additions and 7 deletions.
  1. +5 −1 Data/Text.hs
  2. +5 −1 Data/Text/Encoding/Error.hs
  3. +5 −1 Data/Text/Lazy.hs
  4. +7 −4 text.cabal
View
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, Rank2Types #-}
+{-# LANGUAGE BangPatterns, CPP, Rank2Types #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-- |
@@ -167,7 +167,9 @@ import Prelude (Char, Bool(..), Functor(..), Int, Maybe(..), String,
Read(..), Show(..),
(&&), (||), (+), (-), (.), ($), (>>), (*),
div, not, return, otherwise)
+#if defined(HAVE_DEEPSEQ)
import Control.DeepSeq (NFData)
+#endif
import Control.Exception (assert)
import Data.Char (isSpace)
import Control.Monad (foldM)
@@ -215,7 +217,9 @@ instance Monoid Text where
instance IsString Text where
fromString = pack
+#if defined(HAVE_DEEPSEQ)
instance NFData Text
+#endif
-- -----------------------------------------------------------------------------
-- * Conversion to/from 'Text'
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE CPP, DeriveDataTypeable #-}
-- |
-- Module : Data.Text.Encoding.Error
-- Copyright : (c) Bryan O'Sullivan 2009
@@ -35,7 +35,11 @@ module Data.Text.Encoding.Error
, replace
) where
+#if __GLASGOW_HASKELL__ >= 610
import Control.Exception (Exception, throw)
+#else
+import Control.Exception.Extensible (Exception, throw)
+#endif
import Data.Typeable (Typeable)
import Data.Word (Word8)
import Numeric (showHex)
View
@@ -1,5 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
-{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE BangPatterns, CPP #-}
-- |
-- Module : Data.Text.Lazy
-- Copyright : (c) Bryan O'Sullivan 2009
@@ -169,7 +169,9 @@ import Prelude (Char, Bool(..), Maybe(..), String,
(&&), (+), (-), (.), ($), (++),
div, flip, fromIntegral, not, otherwise)
import qualified Prelude as P
+#if defined(HAVE_DEEPSEQ)
import Control.DeepSeq (NFData(..))
+#endif
import Data.Int (Int64)
import qualified Data.List as L
import Data.Char (isSpace)
@@ -208,9 +210,11 @@ instance Monoid Text where
instance IsString Text where
fromString = pack
+#if defined(HAVE_DEEPSEQ)
instance NFData Text where
rnf Empty = ()
rnf (Chunk _ ts) = rnf ts
+#endif
-- | /O(n)/ Convert a 'String' into a 'Text'.
--
View
@@ -1,5 +1,5 @@
name: text
-version: 0.7
+version: 0.7.0.1
synopsis: An efficient packed Unicode text type
description: An efficient packed Unicode text type.
license: BSD3
@@ -67,11 +67,14 @@ library
build-depends:
base < 5,
- bytestring >= 0.9 && < 1.0,
- deepseq >= 1.1.0.0
+ bytestring >= 0.9 && < 1.0
if impl(ghc >= 6.10)
build-depends:
- ghc-prim, base >= 4
+ ghc-prim, base >= 4, deepseq >= 1.1.0.0
+ cpp-options: -DHAVE_DEEPSEQ
+ else
+ build-depends: extensible-exceptions
+ ghc-options: -XPatternSignatures
-- gather extensive profiling data for now
ghc-prof-options: -auto-all

0 comments on commit 2d354b2

Please sign in to comment.