0

Declare on the follow function -

fun act(f,x) = f(x);

Makes the signature -

val act = fn : ('a -> 'b) * 'a -> 'b

What does ('a -> 'b) * 'a -> 'b means ?

URL87
  • 10,667
  • 35
  • 107
  • 174

1 Answers1

1

It means that act is a function that takes a pair (2-tuple)

('a -> 'b) * 'a

where the first element is a function from 'a to 'b, and the second is a thing of type 'a.
It returns a thing of type 'b.

molbdnilo
  • 64,751
  • 3
  • 43
  • 82