Skip to content

Commit

Permalink
Get the code compiling under GHC 6.8.3.
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : 0b8e7f007385f46bfb82778e805435d607115604
  • Loading branch information
bos committed Dec 23, 2009
1 parent d717402 commit 2d354b2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Data/Text.hs
@@ -1,4 +1,4 @@
{-# LANGUAGE BangPatterns, Rank2Types #-}
{-# LANGUAGE BangPatterns, CPP, Rank2Types #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

-- |
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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'
Expand Down
6 changes: 5 additions & 1 deletion Data/Text/Encoding/Error.hs
@@ -1,4 +1,4 @@
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE CPP, DeriveDataTypeable #-}
-- |
-- Module : Data.Text.Encoding.Error
-- Copyright : (c) Bryan O'Sullivan 2009
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion Data/Text/Lazy.hs
@@ -1,5 +1,5 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BangPatterns, CPP #-}
-- |
-- Module : Data.Text.Lazy
-- Copyright : (c) Bryan O'Sullivan 2009
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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'.
--
Expand Down
11 changes: 7 additions & 4 deletions text.cabal
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d354b2

Please sign in to comment.