Is there an easy way to generically print user-defined types or nested lists in ReasonML?
Context: I'm working on writing check expect procedures for students for an intro CS course I TA and we're using Reason this year for the first time. When the check expect fails I would like to print out both the expected and actual output, but I can't figure out how to effectively print out the result without knowing ahead of time what the type of the arguments is going to be, particularly nested lists and user defined types.
My current workaround: I have written out a different check expect procedures depending on the type they take in (ex. checkExpectListLists which maps over each of the nested lists and recursively prints the arguments.)
Potential help: Sketch.sh is able to evaluate and print out the result of function calls even with user defined types. Does anyone know how they do this/how I can use that functionality in my own check expect printing?
Thanks!