A catamorphism (aka fold) for booleans. This is analogous to
foldr, maybe, and either. The first argument is
the false case, the second argument is the true case, and the last argument
is the predicate value.