You can simply use lst.find(_ > 5) , which will return Option . This is basically the same (but more efficient than) lst.filter(_ > 5).headOption , which will also return an Option or headOption swap for head (very discouraged), which throws an exception if nothing is found.
source share