ListShow, StreamShow, SetShow

11 views
Skip to first unread message

Runar Bjarnason

unread,
May 4, 2012, 4:25:47 PM5/4/12
to sca...@googlegroups.com
I notice that ListShow and SetShow are identical (copy/paste). I need SetShow as well, but don't really want to paste it a third time. Is there something we can do to re-use these?

Jason Zaugg

unread,
May 4, 2012, 5:13:12 PM5/4/12
to sca...@googlegroups.com
The most conservative thing to do is to share the implementation
(using the abstraction mechanisms provided by the Scala colletions),
but keep separate instances that delegate to that shared impl.

In version 6, I tried to share a single instance for many subtypes in
the collections hierarchy, with limited success. (This was a bigger
problem for Equal than Show).

-jason
Reply all
Reply to author
Forward
0 new messages