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