racket-collections icon indicating copy to clipboard operation
racket-collections copied to clipboard

Better default print representation

Open countvajhula opened this issue 2 years ago • 0 comments

In your original talk you suggested that having a better default print representation for streams would make generic collections more user-friendly. In the light of #27 and #28 , what do you think about defining a new sequence type, annotated-sequence which simply wraps a sequence returned from this library and annotates it with known finiteness or anything else that may be useful? In addition, it would include a clean print representation that:

  • prints the entire sequence if it is known-finite?
  • forces the first few elements if it isn't

This would allow us to resolve #27 and #28 . In addition, if all APIs in the library wrapped their result with annotated-sequence, using generic sequences in practice would always have useful print representations, even if the core stream type doesn't.

countvajhula avatar Mar 29 '22 01:03 countvajhula