This doesn't work if `pred` returns `nil` as a falsey value. To check for truthyness, you should use `boolean`.