Basically, I want to have a function to return a polymorphic function, something like this:
fun foo () = fn x => x
So the foo function takes a value of a unit of type and returns a polymorphic identity function and the compiler is happy with it, it gives me:
val foo = fn: unit → 'a →' a
but as soon as I actually call the foo function, the return value does not match the expected
val it = fn:?. X1 →? .X2
Impossible to generalize due to limitation of the meaning he says, any help? thanks in advance
source share