If I\'m using the F# interpreter, I can define a simple function like this:
> // Function to check if x is an integer multiple of y
> let multipleOf x y =
Yuck! This is one of those occasions where the solution to a question occurs to you just as you're about to submit the question to StackOverflow. Hopefully someone will find it useful if I answer it here myself.
It turns out that Scala will play ball on providing type information for functions as long as you tell it to evaluate the function as a partially evaluated function! In other words, the following does the trick:
scala> multipleOf _
res0: (Int, Int) => Boolean =
In other words, the REPL gives you information about the type of a function only if you reevaluate the function as a partially evaluated version of itself. This seems significantly less than optimal. ;-)
Perhaps somebody can mention in the comments why it's sane for Scala to approach things this way?