One of the first things you should do is rewrite the function definition yourself. This will make you actually make out and understand.
fun f (g, nil) = nil
| f (g, x :: xs) = (fn a => g (a, x)) :: f (g, xs);
So, fis a function, even the question says that it should be of type ... -> ...:
val f : ... -> ...
What does he get? Let's look at the first function template:
fun f (g, nil) = nil
- (a, b), 2-. :
val f : (... * ...) -> ...
, , g , nil , nil - . , -:
val f : (... * ... list) -> ...
? nil, , -, , .
val f : (... * ... list) -> ... list
, :
| f (g, x :: xs) = (fn a => g (a, x)) :: f (g, xs);
, , , ::.
:
(fn a => g (a, x)) :: f (g, xs)
, , , , , .. ... list.
.
, , f, . , :
val f : (... * ... list) -> (... -> ...) list
? g 2-. 2- f. , 2-:
val f : (((... * ...) -> ...) * ... list) -> (... -> ...) list
- a, , ? , , g. x? , , g. , - a x? . , g :
('a * 'b) -> 'c'
'a, 'b 'c , .. . . f:
val f : ((('a * 'b) -> 'c) * ... list) -> (... -> ...) list
x, 2-, f, :
val f : ((('a * 'b) -> 'c) * 'b list) -> (... -> ...) list
, .
val f : ((('a * 'b) -> 'c) * 'b list) -> ('a -> 'c) list
, , - :
val f : ('a * 'b -> 'c) * 'b list -> ('a -> 'c) list
. , , - , . ? , . :
1
val f : ('a * 'b -> 'c) * 'b list -> ('a -> 'c) list
val f : (int * bool -> real) * bool list -> (int -> real) list
, 'a int, 'b bool (it book , , , ) 'c . , , , , , . :
2
val f : ('a * 'b -> 'c) * 'b list -> ('a -> 'c) list
val f : (bool * int -> int) * real list -> (bool -> int) list
-type -type :
'a β bool'b β int'c β int'b β real
, , 'b , , .
3 4
2, :)