Implement anyof and allof promise combinators.