Mon Feb 1 14:05:46 CST 2010 Jeremy Shaw * added Data instance for Data.Text.Text For more information see: "could we get a Data instance for Data.Text.Text?" http://groups.google.com/group/haskell-cafe/browse_thread/thread/b5bbb1b28a7e525d/0639d46852575b93 New patches: [added Data instance for Data.Text.Text Jeremy Shaw **20100201200546 Ignore-this: 9a2bff651d05b689951a4703e63da940 For more information see: "could we get a Data instance for Data.Text.Text?" http://groups.google.com/group/haskell-cafe/browse_thread/thread/b5bbb1b28a7e525d/0639d46852575b93 ] hunk ./Data/Text.hs 169 Eq(..), Ord(..), (++), Read(..), Show(..), (&&), (||), (+), (-), (.), ($), (>>), (*), - div, not, return, otherwise) + div, error, not, return, otherwise) #if defined(HAVE_DEEPSEQ) import Control.DeepSeq (NFData) #endif hunk ./Data/Text.hs 175 import Control.Exception (assert) import Data.Char (isSpace) +import Data.Data (Data(gfoldl, toConstr, gunfold, dataTypeOf), mkNoRepType) import Control.Monad (foldM) import Control.Monad.ST (ST) import qualified Data.Text.Array as A hunk ./Data/Text.hs 225 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" + dataTypeOf _ = mkNoRepType "Data.Text.Text" + -- ----------------------------------------------------------------------------- -- * Conversion to/from 'Text' Context: [TAG 0.7.0.1 Bryan O'Sullivan **20091223174807 Ignore-this: 1eda25329c43526a02aef9bc6976c245 ] Patch bundle hash: d889d63296941b34e4ca8b3e0d922ef2006ed9ea