I am supposed to define a function that takes as arguments a list of functions and another list and returns a list of values obtained by applying all the functions, in sequence, over the elements of the list.
I came up with the following but I receive the error:
+: expects type <number> as 1st argument, given: (1 2 3); other arguments were: 1
when I try to use the function with the sample input, (map-many (list (lambda (x) (+ x 1)) (lambda (x) (* x x))) '(1 2 3)). Any suggestions would be appreciated.
(define (map-many fun-list lst)
(if (null? lst) lst
(map ((car fun-list) lst)
(map-many (cdr fun-list) lst))))