Source

attoparsec / Data / Attoparsec / Text / Internal.hs

Diff from to

File 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"