@@ -373,12 +373,17 @@ unpackCString# addr# = Text $ SJS.unstream (SJS.streamCString# addr#)
373-- | lenA == lenB = A.equal arrA offA arrB offB lenA
373-- | lenA == lenB = A.equal arrA offA arrB offB lenA
374-- | otherwise = False
374-- | otherwise = False
375-- {-# INLINE (==) #-}
375-- {-# INLINE (==) #-}
376+instance Eq Text where
377+ Text x == Text y = x == y
377-- instance Ord Text where
379-- instance Ord Text where
378-- compare = compareText
380-- compare = compareText
382+instance Ord Text where
383+ compare (Text x) (Text y) = compare x y
380−-- instance Read Text where
385+instance Read Text where
381−-- readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
386+ readsPrec p str = [(pack x,y) | (x,y) <- readsPrec p str]
383#if MIN_VERSION_base(4,9,0)
388#if MIN_VERSION_base(4,9,0)
384-- Semigroup orphan instances for older GHCs are provided by
389-- Semigroup orphan instances for older GHCs are provided by
@@ -388,17 +393,17 @@ instance Semigroup Text where
388 (<>) = append
393 (<>) = append
391−-- instance Monoid Text where
396+instance Monoid Text where
392−-- mempty = empty
397+ mempty = empty
393−-- #if MIN_VERSION_base(4,9,0)
398+#if MIN_VERSION_base(4,9,0)
394−-- mappend = (<>) -- future-proof definition
399+ mappend = (<>) -- future-proof definition
396−-- mappend = append
401+ mappend = append
398−-- mconcat = concat
403+ mconcat = concat
400−-- instance IsString Text where
405+instance IsString Text where
401−-- fromString = pack
406+ fromString = pack
403#if __GLASGOW_HASKELL__ >= 708
408#if __GLASGOW_HASKELL__ >= 708
404instance Exts.IsList Text where
409instance Exts.IsList Text where
@@ -434,13 +439,13 @@ instance Binary Text where
434-- and 'Data.Map.Map' is archived here:
439-- and 'Data.Map.Map' is archived here:
435-- <http://markmail.org/message/trovdc6zkphyi3cr#query:+page:1+mid:a46der3iacwjcf6n+state:results Proposal: Allow gunfold for Data.Map, ... >
440-- <http://markmail.org/message/trovdc6zkphyi3cr#query:+page:1+mid:a46der3iacwjcf6n+state:results Proposal: Allow gunfold for Data.Map, ... >
437−-- instance Data Text where
442+instance Data Text where
438−-- gfoldl f z txt = z pack `f` (unpack txt)
443+ gfoldl f z txt = z pack `f` (unpack txt)
439−-- toConstr _ = packConstr
444+ toConstr _ = packConstr
440−-- gunfold k z c = case constrIndex c of
445+ gunfold k z c = case constrIndex c of
441−-- 1 -> k (z pack)
446+ 1 -> k (z pack)
442−-- _ -> P.error "gunfold"
447+ _ -> P.error "gunfold"
443−-- dataTypeOf _ = textDataType
448+ dataTypeOf _ = textDataType
445#if MIN_VERSION_base(4,7,0)
450#if MIN_VERSION_base(4,7,0)
446-- | Only defined for @base-4.7.0.0@ and later
451-- | Only defined for @base-4.7.0.0@ and later