@@ -23,11 +23,11 @@ module Data.Text.Fusion.Internal
2323 , empty
2424 , streamList
2525 , unstreamList
26− , eq
2726 ) where
2827
2928infixl 2 :!:
3029data PairS a b = !a :!: !b
30+ deriving (Eq, Ord, Read, Show)
3131
3232-- | Allow a function over a stream to switch between two states.
3333data Switch = S1 | S2
@@ -36,6 +36,14 @@ data Step s a = Done
3636 | Skip !s
3737 | Yield !a !s
3838
39+instance Show a => Show (Step s a)
40+ where show Done = "Done"
41+ show (Skip _) = "Skip"
42+ show (Yield x _) = "Yield " ++ show x
43+
44+instance Eq a => Eq (Stream a) where
45+ (==) = eq
46+
3947-- The length hint in a Stream has two roles. If its value is zero,
4048-- we trust it, and treat the stream as empty. Otherwise, we treat it
4149-- as a hint: it should usually be accurate, so we use it when