racket-collections
racket-collections copied to clipboard
Better default print representation
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.