select(p, [], d) = d
select(p, h::t, d) = h when p(h)
select(p, h::t, d) = select(p, t, d) (otherwise)