on master help sign in
Drop an unneeded type
ac2644bBryan O'Sullivan
Data/Text/Internal/Fusion/Common.hs+8−8
@@ -803,18 +803,18 @@ takeWhile p (Stream next0 s0 len) = Stream next s0 len -- HINT maybe too high
803
803
804-- | dropWhile @p @xs returns the suffix remaining after takeWhile @p @xs.
804-- | dropWhile @p @xs returns the suffix remaining after takeWhile @p @xs.
805dropWhile :: (Char -> Bool) -> Stream Char -> Stream Char
805dropWhile :: (Char -> Bool) -> Stream Char -> Stream Char
806−dropWhile p (Stream next0 s0 len) = Stream next (S1 :*: s0) len -- HINT maybe too high
806+dropWhile p (Stream next0 s0 len) = Stream next (L s0) len -- HINT maybe too high
807 where
807 where
808 {-# INLINE next #-}
808 {-# INLINE next #-}
809− next (S1 :*: s) = case next0 s of
809+ next (L s) = case next0 s of
810 Done -> Done
810 Done -> Done
811− Skip s' -> Skip (S1 :*: s')
811+ Skip s' -> Skip (L s')
812− Yield x s' | p x -> Skip (S1 :*: s')
812+ Yield x s' | p x -> Skip (L s')
813− | otherwise -> Yield x (S2 :*: s')
813+ | otherwise -> Yield x (R s')
814− next (S2 :*: s) = case next0 s of
814+ next (R s) = case next0 s of
815 Done -> Done
815 Done -> Done
816− Skip s' -> Skip (S2 :*: s')
816+ Skip s' -> Skip (R s')
817− Yield x s' -> Yield x (S2 :*: s')
817+ Yield x s' -> Yield x (R s')
818{-# INLINE [0] dropWhile #-}
818{-# INLINE [0] dropWhile #-}
819
819
820-- | /O(n)/ The 'isPrefixOf' function takes two 'Stream's and returns
820-- | /O(n)/ The 'isPrefixOf' function takes two 'Stream's and returns
Data/Text/Internal/Fusion/Types.hs−4
@@ -25,7 +25,6 @@ module Data.Text.Internal.Fusion.Types
25 , RS(..)
25 , RS(..)
26 , Step(..)
26 , Step(..)
27 , Stream(..)
27 , Stream(..)
28− , Switch(..)
29 , empty
28 , empty
30 ) where
29 ) where
31
30
@@ -51,9 +50,6 @@ infixl 2 :*:
51data Scan s = Scan1 {-# UNPACK #-} !Char !s
50data Scan s = Scan1 {-# UNPACK #-} !Char !s
52 | Scan2 {-# UNPACK #-} !Char !s
51 | Scan2 {-# UNPACK #-} !Char !s
53
52
54−-- | Allow a function over a stream to switch between two states.
55−data Switch = S1 | S2
56−
57-- | Intermediate result in a processing pipeline.
53-- | Intermediate result in a processing pipeline.
58data Step s a = Done
54data Step s a = Done
59 | Skip !s
55 | Skip !s