@@ -182,7 +182,7 @@ take :: Property
183 forAll (chooseInt (min_value, max_value)) $ \n ->
183 forAll (chooseInt (min_value, max_value)) $ \n ->
184 forAll (listOf (chooseInt (min_value, max_value))) $ \ls ->
184 forAll (listOf (chooseInt (min_value, max_value))) $ \ls ->
185− case S.parseD (P.fromFold $ FL.ltake n FL.toList) (S.fromList ls) of
185+ case S.parseD (P.fromFold $ FL.takeLE n FL.toList) (S.fromList ls) of
186 Right parsed_list -> checkListEqual parsed_list (Prelude.take n ls)
186 Right parsed_list -> checkListEqual parsed_list (Prelude.take n ls)
187 Left _ -> property False
187 Left _ -> property False
@@ -263,7 +263,7 @@ lookAheadPass :: Property
263lookAheadPass =
263lookAheadPass =
264 forAll (chooseInt (min_value, max_value)) $ \n ->
264 forAll (chooseInt (min_value, max_value)) $ \n ->
266− takeWithoutConsume = P.lookAhead $ P.fromFold $ FL.ltake n FL.toList
266+ takeWithoutConsume = P.lookAhead $ P.fromFold $ FL.takeLE n FL.toList
267 parseTwice = do
267 parseTwice = do
268 parsed_list_1 <- takeWithoutConsume
268 parsed_list_1 <- takeWithoutConsume
269 parsed_list_2 <- takeWithoutConsume
269 parsed_list_2 <- takeWithoutConsume
@@ -279,7 +279,7 @@ lookAhead :: Property
279lookAhead =
279lookAhead =
280 forAll (chooseInt (min_value, max_value)) $ \n ->
280 forAll (chooseInt (min_value, max_value)) $ \n ->
282− takeWithoutConsume = P.lookAhead $ P.fromFold $ FL.ltake n FL.toList
282+ takeWithoutConsume = P.lookAhead $ P.fromFold $ FL.takeLE n FL.toList
283 parseTwice = do
283 parseTwice = do
284 parsed_list_1 <- takeWithoutConsume
284 parsed_list_1 <- takeWithoutConsume
285 parsed_list_2 <- takeWithoutConsume
285 parsed_list_2 <- takeWithoutConsume
@@ -396,7 +396,7 @@ teeWithPass =
396 forAll (chooseInt (min_value, max_value)) $ \n ->
396 forAll (chooseInt (min_value, max_value)) $ \n ->
397 forAll (listOf (chooseInt (0, 1))) $ \ls ->
397 forAll (listOf (chooseInt (0, 1))) $ \ls ->
399− prsr = P.fromFold $ FL.ltake n FL.toList
399+ prsr = P.fromFold $ FL.takeLE n FL.toList
401 case S.parseD (P.teeWith (,) prsr prsr) (S.fromList ls) of
401 case S.parseD (P.teeWith (,) prsr prsr) (S.fromList ls) of
402 Right (ls_1, ls_2) -> checkListEqual (Prelude.take n ls) ls_1 .&&. checkListEqual ls_1 ls_2
402 Right (ls_1, ls_2) -> checkListEqual (Prelude.take n ls) ls_1 .&&. checkListEqual ls_1 ls_2
@@ -536,8 +536,8 @@ applicative =
536 forAll (listOf (chooseAny :: Gen Int)) $ \ list2 ->
536 forAll (listOf (chooseAny :: Gen Int)) $ \ list2 ->
537 let parser =
537 let parser =
539− <$> P.fromFold (FL.ltake (length list1) FL.toList)
539+ <$> P.fromFold (FL.takeLE (length list1) FL.toList)
540− <*> P.fromFold (FL.ltake (length list2) FL.toList)
540+ <*> P.fromFold (FL.takeLE (length list2) FL.toList)
541 in monadicIO $ do
541 in monadicIO $ do
542 (olist1, olist2) <-
542 (olist1, olist2) <-
543 run $ S.parseD parser (S.fromList $ list1 ++ list2)
543 run $ S.parseD parser (S.fromList $ list1 ++ list2)
@@ -547,7 +547,7 @@ applicative =
547sequence :: Property
547sequence :: Property
548sequence =
548sequence =
549 forAll (vectorOf 11 (listOf (chooseAny :: Gen Int))) $ \ ins ->
549 forAll (vectorOf 11 (listOf (chooseAny :: Gen Int))) $ \ ins ->
550− let parsers = fmap (\xs -> P.fromFold $ FL.ltake (length xs) FL.toList) ins
550+ let parsers = fmap (\xs -> P.fromFold $ FL.takeLE (length xs) FL.toList) ins
551 in monadicIO $ do
551 in monadicIO $ do
552 outs <- run $
552 outs <- run $
@@ -560,8 +560,8 @@ monad =
560 forAll (listOf (chooseAny :: Gen Int)) $ \ list1 ->
560 forAll (listOf (chooseAny :: Gen Int)) $ \ list1 ->
561 forAll (listOf (chooseAny :: Gen Int)) $ \ list2 ->
561 forAll (listOf (chooseAny :: Gen Int)) $ \ list2 ->
562 let parser = do
562 let parser = do
563− olist1 <- P.fromFold (FL.ltake (length list1) FL.toList)
563+ olist1 <- P.fromFold (FL.takeLE (length list1) FL.toList)
564− olist2 <- P.fromFold (FL.ltake (length list2) FL.toList)
564+ olist2 <- P.fromFold (FL.takeLE (length list2) FL.toList)
565 return (olist1, olist2)
565 return (olist1, olist2)
566 in monadicIO $ do
566 in monadicIO $ do
567 (olist1, olist2) <-
567 (olist1, olist2) <-
@@ -582,7 +582,7 @@ parseMany =
583 $ S.toList
583 $ S.toList
584 $ S.parseManyD
584 $ S.parseManyD
585− (P.fromFold $ FL.ltake len FL.toList) (S.fromList $ concat ins)
585+ (P.fromFold $ FL.takeLE len FL.toList) (S.fromList $ concat ins)
587 listEquals (==) outs ins
587 listEquals (==) outs ins