on master help sign in
Drop an unneeded type
commitac2644bb47d1ed6f29076ab5a9eb3d5ca74eb4be authorBryan O'Sullivan <bos@serpentine.com> dateFri 8 May 2015, 13:52 (11 years ago) parent381d7c2
2 files changed+8−12
Data/Text/Internal/Fusion/Common.hs+8−8 Data/Text/Internal/Fusion/Types.hs−4
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
803803
804804-- | dropWhile @p @xs returns the suffix remaining after takeWhile @p @xs.
805805dropWhile :: (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
807807 where
808808 {-# INLINE next #-}
809− next (S1 :*: s) = case next0 s of
809+ next (L s) = case next0 s of
810810 Done -> Done
811− Skip s' -> Skip (S1 :*: s')
812− Yield x s' | p x -> Skip (S1 :*: s')
813− | otherwise -> Yield x (S2 :*: s')
814− next (S2 :*: s) = case next0 s of
811+ Skip s' -> Skip (L s')
812+ Yield x s' | p x -> Skip (L s')
813+ | otherwise -> Yield x (R s')
814+ next (R s) = case next0 s of
815815 Done -> Done
816− Skip s' -> Skip (S2 :*: s')
817− Yield x s' -> Yield x (S2 :*: s')
816+ Skip s' -> Skip (R s')
817+ Yield x s' -> Yield x (R s')
818818{-# INLINE [0] dropWhile #-}
819819
820820-- | /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
2525 , RS(..)
2626 , Step(..)
2727 , Stream(..)
28− , Switch(..)
2928 , empty
3029 ) where
3130
@@ -51,9 +50,6 @@ infixl 2 :*:
5150data Scan s = Scan1 {-# UNPACK #-} !Char !s
5251 | Scan2 {-# UNPACK #-} !Char !s
5352
54−-- | Allow a function over a stream to switch between two states.
55−data Switch = S1 | S2
56−
5753-- | Intermediate result in a processing pipeline.
5854data Step s a = Done
5955 | Skip !s