:: (a -> Bool) -> (a -> Bool) -> (a -> Bool) -package:foldl -is:exact -package:syb -package:leancheck

Lift boolean or over predicates.
Try to run a function, on pattern match fail run the provided handler instead.
>>> reverse `onMismatch` (\"needle" -> "Found It") $ "haystack"
"kcatsyah"

>>> reverse `onMismatch` (\"needle" -> "Found It") $ "needle"
"Found It"
Infix version of flip onMismatch It tries the patterns in order from left to right. The last handler in the chain MUST be total or the chain could fail with a PatternMatchFail
>>> (\1 -> "got 1") ||> (\2 -> "got 2") ||> show $ 1
"got 1"

>>> (\1 -> "got 1") ||> (\1 -> "again") ||> (\2 -> "got 2") ||> show $ 2
"got 2"

>>> (\1 -> "got 1") ||> (\1 -> "again") ||> (\2 -> "got 2") ||> show $ 3
"3"