Is there a way to print polymorphic values in Standard ML (SML/NJ specifically)? I have a polymorphic function that is not doing what I want and due to the abysmal state that is debugging in SML (see Any real world experience debugging a production functional program?), I would like to see what it is doing with some good-ol' print
's. A simple example would be (at a prompt):
fun justThisOnce(x : 'a) : 'a = (print(x); x);
justThisOnce(42);
Other suggestions are appreciated. In the meantime I'll keep staring the offending code into submission.
Update
I was able to find the bug but the question still stands in the hopes of preventing future pain and suffering.