HasRepr vs. (IsTraversableOnce, IsTraversableLike)

39 views
Skip to first unread message

Josh Suereth

unread,
Jun 27, 2012, 2:49:55 PM6/27/12
to scala-i...@googlegroups.com
https://github.com/scala/scala/pull/792

I decided to clean up the collection extension method mechanism so that it:
  • Had less sprawl
  • Allowed abstracting over Iterator[_]
  • Allowed value classes  (failure in GenJVM for that right now...)
Just wanted to grab some folks attention/opinions (especially Miles) on that pull request before it gets merged.


Thanks!
- Josh

Miles Sabin

unread,
Jun 28, 2012, 4:00:56 AM6/28/12
to scala-i...@googlegroups.com
Looks good to me. I'd avoided the use of a dependent method type (ie.
the result type of fr.A) to allow for 2.9.x compatibility and because
it's maybe not a completely familiar idiom to expect collections
extensions writers to use. But if it's OK on both those counts then I
think it improves things on balance.

Cheers,


Miles

--
Miles Sabin
tel: +44 7813 944 528
gtalk: mi...@milessabin.com
skype: milessabin
g+: http://www.milessabin.com
http://twitter.com/milessabin
http://underscoreconsulting.com
http://www.chuusai.com

Josh Suereth

unread,
Jun 28, 2012, 8:01:02 AM6/28/12
to scala-i...@googlegroups.com

The dependent type was there but inferred before.   It's an incredibly good idea to fully specify return types for implicit methods, so I'd prefer to leave it as is....

Heiko Seeberger

unread,
Jun 29, 2012, 12:52:14 PM6/29/12
to scala-i...@googlegroups.com
On Jun 28, 2012, at 2:01 PM, Josh Suereth wrote:

It's an incredibly good idea to fully specify return types for implicit methods,

+1

Heiko

Reply all
Reply to author
Forward
0 new messages