@@ -195,7 +195,7 @@ import qualified Data.Text.Fusion.Common as S
195195import Data.Text.Fusion (stream, reverseStream, unstream)
196196import Data.Text.Internal (Text(..), empty, text, textP)
197197import qualified Prelude as P
198−import Data.Text.Unsafe (iter, iter_, reverseIter, unsafeHead, unsafeTail)
198+import Data.Text.Unsafe (Iter(..), iter, iter_, reverseIter, unsafeHead, unsafeTail)
199199import Data.Text.UnsafeChar (unsafeChr)
200200import qualified Data.Text.Encoding.Utf16 as U16
201201import Data.Text.Search (indices)
@@ -329,7 +329,7 @@ uncons :: Text -> Maybe (Char, Text)
329329uncons t@(Text arr off len)
330330 | len <= 0 = Nothing
331331 | otherwise = Just (c, textP arr (off+d) (len-d))
332− where (c,d) = iter t 0
332+ where Iter c d = iter t 0
333333{-# INLINE [1] uncons #-}
334334
335335-- | Lifted from Control.Arrow and specialized.
@@ -811,7 +811,7 @@ takeWhile p t@(Text arr off len) = loop 0
811811 where loop !i | i >= len = t
812812 | p c = loop (i+d)
813813 | otherwise = textP arr off i
814− where (c,d) = iter t i
814+ where Iter c d = iter t i
815815{-# INLINE [1] takeWhile #-}
816816
817817{-# RULES
@@ -828,7 +828,7 @@ dropWhile p t@(Text arr off len) = loop 0 0
828828 where loop !i !l | l >= len = empty
829829 | p c = loop (i+d) (l+d)
830830 | otherwise = Text arr (off+i) (len-l)
831− where (c,d) = iter t i
831+ where Iter c d = iter t i
832832{-# INLINE [1] dropWhile #-}
833833
834834{-# RULES
@@ -912,7 +912,7 @@ spanBy p t@(Text arr off len) = (textP arr off k, textP arr (off+k) (len-k))
912912 where k = loop 0
913913 loop !i | i >= len || not (p c) = i
914914 | otherwise = loop (i+d)
915− where (c,d) = iter t i
915+ where Iter c d = iter t i
916916{-# INLINE spanBy #-}
917917
918918-- | /O(n)/ 'breakBy' is like 'spanBy', but the prefix returned is
@@ -928,7 +928,7 @@ groupBy p = loop
928928 loop t@(Text arr off len)
929929 | null t = []
930930 | otherwise = text arr off n : loop (text arr (off+n) (len-n))
931− where (c,d) = iter t 0
931+ where Iter c d = iter t 0
932932 n = d + findAIndexOrEnd (not . p c) (Text arr (off+d) (len-d))
933933
934934-- | Returns the /array/ index (in units of 'Word16') at which a
@@ -938,7 +938,7 @@ findAIndexOrEnd :: (Char -> Bool) -> Text -> Int
938938findAIndexOrEnd q t@(Text _arr _off len) = go 0
939939 where go !i | i >= len || q c = i
940940 | otherwise = go (i+d)
941− where (c,d) = iter t i
941+ where Iter c d = iter t i
942942
943943-- | /O(n)/ Group characters in a string by equality.
944944group :: Text -> [Text]
@@ -1209,7 +1209,7 @@ words t@(Text arr off len) = loop 0 0
12091209 then loop (start+1) (start+1)
12101210 else Text arr (start+off) (n-start) : loop (n+d) (n+d)
12111211 | otherwise = loop start (n+d)
1212− where (c,d) = iter t n
1212+ where Iter c d = iter t n
12131213{-# INLINE words #-}
12141214
12151215-- | /O(n)/ Breaks a 'Text' up into a list of 'Text's at