Commits

Bryan O'Sullivan committed 314c1c2

text: use splitAt instead of take&drop

Comments (0)

Files changed (1)

Data/Attoparsec/Text/Internal.hs

 takeWith :: Int -> (Text -> Bool) -> Parser Text
 takeWith n p = do
   s <- ensure n
-  let h = unsafeTake n s
-      t = unsafeDrop n s
+  let (h,t) = T.splitAt n s
   if p h
     then put t >> return h
     else fail "takeWith"