Hello,
The Data.Set
function findIndex
has the following type signature:
findIndex :: Ord a => a -> Set a -> Int
However, it will throw an error if and when the index can’t be found.
If the index is out of range (less than zero, greater or equal to size of the set), error is called.
What is a common approach to “catching” when this happens?
This way, I can create a function such as:
findIndex :: Text -> FieldValues -> Maybe Int
Thanks to anyone with some guidance here.