I'm having a hard time understanding how to build a solution to a homework problem I have for lambda expressions. I have to write a function that takes a single argument, F, that is a predicate function and returns a new function that is F's converse.
I know that somewhere in my function I will return the not of the value from the passed in predicate function to return the converse but I'm confused about the rest of the problem description. The problem states that "You will need a lambda inside a lambda. Since you don't know how many arguments F will take (and might in fact take a variable number) you will have to use apply and the syntax for defining a lambda expression that takes any number of arguments"
I don't understand how to set up the nested lambda expressions to do what I want with returning the converse of whatever F may be. I've been experimenting with a few different things just to see if I can get anywhere, but I don't understand how nested lambda expressions work enough to get me anywhere.
(define converse
(lambda (F)
(lambda
(apply (not (F))))))
I know this won't work but I need help understanding how to set up my nested lambda expressions to do what I want.