Is there a way to print polymorphic values ββin standard ML (specifically for SML / NJ)? I have a polymorphic function that does not do what I want, and because of the absurd state that debugs in SML (see Any real-world experience debugging a production functional program? ), I would like to see what it does with some good print tins. A simple example would be (at the tip):
fun justThisOnce(x : 'a) : 'a = (print(x); x); justThisOnce(42);
Other suggestions are welcome. In the meantime, I will continue to look at breaking code in submission.
Update
I could find a mistake, but the question still stands in the hope of preventing future pain and suffering.
polymorphism functional-programming printing sml
Andrew Keeton
source share