text: use splitAt instead of take&drop
commit3044565a88138a5682815d5beb51d03080be5e6d
authorBryan O'Sullivan <bos@serpentine.com>
dateWed 23 Jan 2013, 20:45 (14 years ago)
parent666b0a7
Data/Attoparsec/Text/Internal.hs+1−2
@@ -211,8 +211,7 @@ satisfyWith f p = do
211211takeWith :: Int -> (Text -> Bool) -> Parser Text
212212takeWith n p = do
213213 s <- ensure n
214− let h = unsafeTake n s
215− t = unsafeDrop n s
214+ let (h,t) = T.splitAt n s
216215 if p h
217216 then put t >> return h
218217 else fail "takeWith"