all package:text

O(n) all p t determines whether all characters in the Text t satisfy the predicate p.
O(n) all p xs determines if all characters in the Text xs satisfy the predicate p. Properties
all f . stream = all f
O(n+m) Find all non-overlapping instances of needle in haystack. Each element of the returned list consists of a pair:
  • The entire string prior to the kth match (i.e. the prefix)
  • The kth match, followed by the remainder of the string
Examples:
>>> breakOnAll "::" ""
[]
>>> breakOnAll "/" "a/b/c/"
[("a","/b/c/"),("a/b","/c/"),("a/b/c","/")]
In (unlikely) bad cases, this function's time complexity degrades towards O(n*m). The needle parameter may not be empty.
Minimum of two size hints.
Currently set to 128 bytes, less the memory management overhead.
O(n+m) Find all non-overlapping instances of needle in haystack. Each element of the returned list consists of a pair:
  • The entire string prior to the kth match (i.e. the prefix)
  • The kth match, followed by the remainder of the string
Examples:
breakOnAll "::" ""
==> []
breakOnAll "/" "a/b/c/"
==> [("a", "/b/c/"), ("a/b", "/c/"), ("a/b/c", "/")]
This function is strict in its first argument, and lazy in its second. In (unlikely) bad cases, this function's time complexity degrades towards O(n*m). The needle parameter may not be empty.