One of the exercises I am trying has defined a function as follows:
twice f x = f (f x)
When I print the type of twice I see:
Main> :t twice
twice :: (a -> a) -> a -> a
Not sure I understand the output here. So twice takes an input of type function (which is of type a -> a). Is this correct? If so then how was the f evaluated to be of type function (a -> a)? And then what is the return type of twice here?