Well, in the written-shared/pretty-shared case, Alex Shinn (I just ported his reference implementation) relies on display/write for everything except lists and vectors, and those are, from what I can tell, exhaustively checked for cycles.
trimmed/lazy I have to have a read through in some other way than black-on-white text on my 3.5" phone. Best regards Linus -- Linus Björnstam On Sun, 16 Jun 2019, at 08:37, Mark H Weaver wrote: > Hi Linus, > > Linus Björnstam <[email protected]> writes: > > > I am not sure I understand what you mean, but i suspect it is already > > solved, since for simple cases show will use display/write. So unless > > you try to do advanced formatting of circular lists it will do > > whatever display or write does. The same thing goes for custom > > printers. > > How do you implement 'written-shared', 'pretty-shared', and > 'trimmed/lazy'? In particular, how do you avoid non-termination when > asked to print cyclic data, when the cycle includes a non-standard data > type printed using a custom printer? For example, what if you print a > list that includes an object whose custom printer will print output that > includes the same list that you started with? > > Regards, > Mark >
