text 0.7.0.1 → 0.7.1.0
raw patch · 3 files changed
+47/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Data.Text: instance Data Text
+ Data.Text.Lazy: instance Data Text
Files
- Data/Text.hs +29/−1
- Data/Text/Lazy.hs +17/−1
- text.cabal +1/−1
Data/Text.hs view
@@ -166,12 +166,18 @@ Eq(..), Ord(..), (++), Read(..), Show(..), (&&), (||), (+), (-), (.), ($), (>>), (*),- div, not, return, otherwise)+ div, error, not, return, otherwise) #if defined(HAVE_DEEPSEQ) import Control.DeepSeq (NFData) #endif import Control.Exception (assert) import Data.Char (isSpace)+import Data.Data (Data(gfoldl, toConstr, gunfold, dataTypeOf))+#if __GLASGOW_HASKELL__ >= 612+import Data.Data (mkNoRepType)+#else+import Data.Data (mkNorepType)+#endif import Control.Monad (foldM) import Control.Monad.ST (ST) import qualified Data.Text.Array as A@@ -219,6 +225,28 @@ #if defined(HAVE_DEEPSEQ) instance NFData Text+#endif++-- This instance preserves data abstraction at the cost of inefficiency.+-- We omit reflection services for the sake of data abstraction.+-- +-- This instance was created by copying the behavior of Data.Set and+-- Data.Map. If you feel a mistake has been made, please feel free to+-- submit improvements.+--+-- Original discussion is archived here:++-- "could we get a Data instance for Data.Text.Text?"+-- http://groups.google.com/group/haskell-cafe/browse_thread/thread/b5bbb1b28a7e525d/0639d46852575b93++instance Data Text where+ gfoldl f z txt = z pack `f` (unpack txt)+ toConstr _ = error "Data.Text.Text.toConstr"+ gunfold _ _ = error "Data.Text.Text.gunfold"+#if __GLASGOW_HASKELL__ >= 612+ dataTypeOf _ = mkNoRepType "Data.Text.Text"+#else+ dataTypeOf _ = mkNorepType "Data.Text.Text" #endif -- -----------------------------------------------------------------------------
Data/Text/Lazy.hs view
@@ -167,7 +167,7 @@ import Prelude (Char, Bool(..), Maybe(..), String, Eq(..), Ord(..), Read(..), Show(..), (&&), (+), (-), (.), ($), (++),- div, flip, fromIntegral, not, otherwise)+ div, error, flip, fromIntegral, not, otherwise) import qualified Prelude as P #if defined(HAVE_DEEPSEQ) import Control.DeepSeq (NFData(..))@@ -175,6 +175,12 @@ import Data.Int (Int64) import qualified Data.List as L import Data.Char (isSpace)+import Data.Data (Data(gfoldl, toConstr, gunfold, dataTypeOf))+#if __GLASGOW_HASKELL__ >= 612+import Data.Data (mkNoRepType)+#else+import Data.Data (mkNorepType)+#endif import Data.Monoid (Monoid(..)) import Data.String (IsString(..)) import qualified Data.Text as T@@ -214,6 +220,16 @@ instance NFData Text where rnf Empty = () rnf (Chunk _ ts) = rnf ts+#endif++instance Data Text where+ gfoldl f z txt = z pack `f` (unpack txt)+ toConstr _ = error "Data.Text.Lazy.Text.toConstr"+ gunfold _ _ = error "Data.Text.Lazy.Text.gunfold"+#if __GLASGOW_HASKELL__ >= 612+ dataTypeOf _ = mkNoRepType "Data.Text.Lazy.Text"+#else+ dataTypeOf _ = mkNorepType "Data.Text.Lazy.Text" #endif -- | /O(n)/ Convert a 'String' into a 'Text'.
text.cabal view
@@ -1,5 +1,5 @@ name: text-version: 0.7.0.1+version: 0.7.1.0 synopsis: An efficient packed Unicode text type description: An efficient packed Unicode text type. license: BSD3