This exercise is on book《Functional Programming Using F#》.
Exercise 4.18
let rec f g = function
| [] -> [] 
| x::xs -> g x :: f (fun y -> g(g y)) xs;;
//Find the type for f and explain the value of the expression:
f g [x0; x1; x2; . . . ; xn−1]
- 
    From let rec f g = function, we can not make sure anything about f and g.f: ??->?? 
- 
    According to the []->[], it is clear that the result offis a type of list, but we can not deduce which type it is. And the input offis also a list.We could guess that(It is wrong after reading the next line). For we can not deduce the concrete type so here we set it as an abstract type :gis an argument whose type is a list'af: ‘a list -> ‘a list 
- 
    The pattern x::xsensures our deduce of the input of f is a list. But then we find the usage ofg x. So we get an error deduce thatgis an argument of list– actuallygis a function here. So there is an additional parameter_argwhich is a list.f: g:(??->??)->_arg: ‘a list -> ‘a list Then with f (fun y -> g(g y)) xs, we could ensure thatfis a function with two parameters:(fun y -> g(g y))(g) andxs(_arg). And withg(g y)),we could determine that the input and result ofgis the same.f: g:(‘a ->’a )->_arg: ‘a list -> ‘a list