Basically, I want to have a function to return a polymorphic function, some thing like this:
fun foo () = fn x => x
So the foo function takes in a value of type unit and returns a polymorphic identity function and the compiler is happy with that, it gives me:
val foo = fn : unit -> a -> a
but once I actually call the foo function, the return value is not what I expected
val it = fn : ?.X1 -> ?.X2
Can t generalize because of value restriction it says, any help? thanks in advance