187k views
4 votes
Write an ML function definition for each of the following functions.

1.f(g,x,y) = g(x,y)
2.f(g,h,x) = g(h(x))
3.f(g,x) = g(g(x))

1 Answer

4 votes

Final answer:

The ML function definitions for the given functions are provided.

Step-by-step explanation:

1. The function definition for f(g,x,y) = g(x,y) is:

def f(g,x,y):
return g(x,y)

2. The function definition for f(g,h,x) = g(h(x)) is:

def f(g,h,x):
return g(h(x))

3. The function definition for f(g,x) = g(g(x)) is:

def f(g,x):
return g(g(x))