find package:text-short

Return the left-most codepoint in ShortText that satisfies the given predicate.
>>> find (> 'b') "abcdabcd"
Just 'c'
>>> find (> 'b') "ababab"
Nothing
Return the index of the left-most codepoint in ShortText that satisfies the given predicate.
>>> findIndex (> 'b') "abcdabcdef"
Just 2
>>> findIndex (> 'b') "ababab"
Nothing
(indexMaybe t =<< findIndex p t) == find p t