Let's say I have my own data structure, as a stupid example, type 'a mylist = Empty | Cons of 'a * ('a mylist) type 'a mylist = Empty | Cons of 'a * ('a mylist) .
I would like theplevel to print this list in the form {a,b,...} . Here a , b type 'a are printed according to the print function set at the top level with #install_printer, or if it is not, as <abstr> .
I know how I would define a print function for a monomorphic mylist, but is there a polymorphic way to tell Tofulev to simply put { and } and use what he already knows for any type of what happens between them?
source share