As a follow-on to F# fsi.AddPrinter: Does AddPrinter have ability to take list apart?
I was not aware that type printers should provide for handling a list as input.
As such, are there any published standards for what is/should be required of a type printer?
Can you please provide references to examples of such code.
I advise you not to do so. If you do it, you break KISS principle and may surprise other team members with a strange way of displaying very standard
'T list. Just provide a printer for'Tand let F# Interactive figure out the rest.You may consider this case
where you care about
Theoremand would like to display it in an appropriate way. Then it makes sense to define a printer so that aTheoremis printed out asThis example isn’t a very good example because you probably prefer a type-safe solution
That said, you may ask whether you should go for
fsi.AddPrinterat all. Thefsi.AddPrinterbits may be there due to legacy reasons. More universal solutions are to overrideToString()methods and to use StructuredFormatDisplay attribute in order that you have good printers for bothfscandfsi, which work withprintf "%A",printf "%O", etc.