Josh Suereth | 27 Jun 2012 20:49
Picon
Gravatar

HasRepr vs. (IsTraversableOnce, IsTraversableLike)

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 | 28 Jun 2012 10:00
Gravatar

Re: HasRepr vs. (IsTraversableOnce, IsTraversableLike)

On Wed, Jun 27, 2012 at 7:49 PM, Josh Suereth
<joshua.suereth@...> wrote:
> 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.

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: miles@...
skype: milessabin
g+: http://www.milessabin.com
http://twitter.com/milessabin
http://underscoreconsulting.com
http://www.chuusai.com

Josh Suereth | 28 Jun 2012 14:01
Picon
Gravatar

Re: HasRepr vs. (IsTraversableOnce, IsTraversableLike)

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....

On Jun 28, 2012 4:01 AM, "Miles Sabin" <miles-XKJT71GPLR04Q++5jOxPmw@public.gmane.org> wrote:
On Wed, Jun 27, 2012 at 7:49 PM, Josh Suereth <joshua.suereth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 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.

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: miles-XKJT71GPLR04Q++5jOxPmw@public.gmane.org
skype: milessabin
g+: http://www.milessabin.com
http://twitter.com/milessabin
http://underscoreconsulting.com
http://www.chuusai.com
Heiko Seeberger | 29 Jun 2012 18:52
Gravatar

Re: HasRepr vs. (IsTraversableOnce, IsTraversableLike)

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


Gmane