writing filter function using foldr?
<p>Currently trying to write a filter function that takes a list of procedures and a list of numbers, deletes the procedures that does not return true on every element of the list of numbers.</p>

<p>What I have done is the following, currently taking a single procedure and runs through the list to create a list stating whether the procedure is true or false for each element.</p>

<p>Using foldr, or map if required (non recursive)</p>

<pre><code> (define (my-filter ps xs)
    (foldr (λ (x y)
             (cons (ps x) y)) '() xs))
</code></pre>

<p>How do I delete the procedure if it has at lease one #f?</p>

<p>i.e. 
currently</p>

<pre><code>&gt; (my-filter even? '(1 2 3 4))
(#f #t #f #t)
&gt; (my-filter even? (2 4))
(#t #t)
</code></pre>

<p>want</p>

<pre><code>&gt; (my-filter (list even?) '(1 2 3 4))
(list)
&gt; (my-filter (list even?) '(2 4))
(list even?)
</code></pre>