How does one print any type?

One way to do this is to iterate over the runtime structure. You can get quite good information out of this, although it’s not a complete view of the compile time types by any means. I wrote a utility to do this called Dumper: https://web.archive.org/web/20101101234304/http://merjis.com/developers/dumper

It’s pure OCaml and doesn’t require any libraries, weird syntax, modifications to your source code or anything like that.

2 Likes