find package:rio

O(n) The find function takes a predicate and a ByteString, and returns the first element in matching the predicate, or Nothing if there is no such element.
find f p = case findIndex f p of Just n -> Just (p ! n) ; _ -> Nothing
The find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.
O(n) The find function takes a predicate and a Text, and returns the first element matching the predicate, or Nothing if there is no such element.
O(n) The find function takes a predicate and a Text, and returns the first element in matching the predicate, or Nothing if there is no such element.
O(n) Yield Just the first element matching the predicate or Nothing if no such element exists.
O(n) Yield Just the first element matching the predicate or Nothing if no such element exists.
O(n) Yield Just the first element matching the predicate or Nothing if no such element exists.
O(n) Yield Just the first element matching the predicate or Nothing if no such element exists.
The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate.
The findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.
The findIndex function takes a predicate and a ByteString and returns the index of the first element in the ByteString satisfying the predicate.
The findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.
The findIndex function takes a predicate and a list and returns the index of the first element in the list satisfying the predicate, or Nothing if there is no such element.
>>> findIndex isSpace "Hello World!"
Just 5
The findIndices function extends findIndex, by returning the indices of all elements satisfying the predicate, in ascending order.
>>> findIndices (`elem` "aeiou") "Hello World!"
[1,4,7]
O(log n). The expression (findWithDefault def k map) returns the value at key k or returns default value def when the key is not in the map.
findWithDefault 'x' 1 (fromList [(5,'a'), (3,'b')]) == 'x'
findWithDefault 'x' 5 (fromList [(5,'a'), (3,'b')]) == 'a'
O(log n). Return the index of a key, which is its zero-based index in the sequence sorted by keys. The index is a number from 0 up to, but not including, the size of the map. Calls error when the key is not a member of the map.
findIndex 2 (fromList [(5,"a"), (3,"b")])    Error: element is not in the map
findIndex 3 (fromList [(5,"a"), (3,"b")]) == 0
findIndex 5 (fromList [(5,"a"), (3,"b")]) == 1
findIndex 6 (fromList [(5,"a"), (3,"b")])    Error: element is not in the map
O(log n). The minimal key of the map. Calls error if the map is empty.
findMin (fromList [(5,"a"), (3,"b")]) == (3,"b")
findMin empty                            Error: empty map has no minimal element
Find the complete path for the given executable name. On POSIX systems, filenames that match but are not exectuables are excluded. On Windows systems, the executable names tried, in turn, are the supplied name (only if it has an extension) and that name extended by each of the exeExtensions. Also, this function may behave differently from findExecutable. The latter excludes as executables filenames without a .bat, .cmd, .com or .exe extension (case-insensitive).
findIndexL p xs finds the index of the leftmost element that satisfies p, if any exist.
findIndexR p xs finds the index of the rightmost element that satisfies p, if any exist.
findIndicesL p finds all indices of elements that satisfy p, in ascending order.
findIndicesR p finds all indices of elements that satisfy p, in descending order.
O(log n). Return the index of an element, which is its zero-based index in the sorted sequence of elements. The index is a number from 0 up to, but not including, the size of the set. Calls error when the element is not a member of the set.
findIndex 2 (fromList [5,3])    Error: element is not in the set
findIndex 3 (fromList [5,3]) == 0
findIndex 5 (fromList [5,3]) == 1
findIndex 6 (fromList [5,3])    Error: element is not in the set
O(log n). The maximal element of a set.