I am wondering how to convert the explicit recursive functions below into a higher-ordered/abstract functions using foldr, map, filter, etc in Scheme/Racket.
(define (insertNoDups f element lst)
(cond[(empty? lst) (cons element lst)]
[(f element (first lst)) lst]
[else (cons (first lst)
(insertNoDups f element (rest lst)))]))
(define (remove-dups f lst)
(cond[(empty? lst) empty]
[else (insertNoDups f
(first lst)
(remove-dups f (rest lst)))]))