@@ -254,8 +254,20 @@ import Data.Int (Int64)
254-- Functions that can be fused by the compiler are marked with the
254-- Functions that can be fused by the compiler are marked with the
255-- phrase \"Subject to fusion\".
255-- phrase \"Subject to fusion\".
257+eq :: Text -> Text -> Bool
258+eq (Text arrA offA lenA) (Text arrB offB lenB)
259+ | lenA /= lenB = False
262+ go !n | n == lenA = True
264+ | otherwise = go (n+1)
265+ where a = A.unsafeIndex arrA (offA+n)
266+ b = A.unsafeIndex arrB (offB+n)
257instance Eq Text where
269instance Eq Text where
258− t1 == t2 = stream t1 == stream t2
270+ (==) = eq
259 {-# INLINE (==) #-}
271 {-# INLINE (==) #-}
261instance Ord Text where
273instance Ord Text where