Re: Case class companion objects extending FunctionN in line with SLS?

Adriaan Moors <[email protected]> Wed, 21 Dec 2016 16:26:15 +0000
Newsgroups gmane.comp.lang.scala
Message-ID <CA+cgcwZ_xoMPaxA6py7y-KWyqH2D1OC7TdHjYXuGh5nujFCHpA@mail.gmail.com>
--001a11484f5647c1e305442d9d33
Content-Type: text/plain; charset=UTF-8

I was making a silly joke <http://something-else.urbanup.com/2029280> ;-)
You give me three options and I can pick either one? Is this some kind of
off-by-one puzzler :-D

Seriously, though, I can see the appeal, but as it stands, it's an historic
artifact or implementation detail/quirk (it's tricky to add parents to
existing companion objects).

I agree it's surprising that some but not all companions inherit FunctionN
(though user-defined companions are treated differently in other ways too).
The original intent was to remove this surprise by not adding synthetic
parents to any companion. We currently don't have plans to change this
though. Ultimately, it would be great to see a shapeless-light SIP that
allows generically traversing structures of case classes.

cheers
adriaan

On Wed, Dec 21, 2016 at 5:04 AM Andrew Phillips <[email protected]>
wrote:

> > See also https://issues.scala-lang.org/browse/SI-3664,
> https://issues.scala-lang.org/browse/SI-5570
>
> Ah, thanks for the links, Adriaan! Going through the discussion threads,
> I'm not quite clear how to summarize the "something else" that you refer to
> ;-) There are a couple of comments that categorize this as spec omissions,
> and others that point to this being deliberately not in the spec, and
> rather an "implementation side-effect" that one presumably shouldn't rely
> on.
>
> Could you confirm if either of those two is the correct interpretation?
>
> Thanks!
>
> ap
>
> --
> You received this message because you are subscribed to the Google Groups
> "scala-language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.

--001a11484f5647c1e305442d9d33
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I was making a <a href=3D"http://something-else.urbanup.co=
m/2029280">silly joke</a>=C2=A0;-) You give me three options and I can pick=
 either one? Is this some kind of off-by-one puzzler :-D<div><br></div><div=
>Seriously, though, I can see the appeal, but as it stands, it&#39;s an his=
toric artifact or implementation detail/quirk (it&#39;s tricky to add paren=
ts to existing companion objects).=C2=A0</div><div><br></div><div>I agree i=
t&#39;s surprising that some but not all companions inherit FunctionN (thou=
gh user-defined companions are treated differently in other ways too). The =
original intent was to remove this surprise by not adding synthetic parents=
 to any companion. We currently don&#39;t have plans to change this though.=
 Ultimately, it would be great to see a shapeless-light SIP that allows gen=
erically traversing structures of case classes.</div><div><br></div><div>ch=
eers</div><div>adriaan</div></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr">On Wed, Dec 21, 2016 at 5:04 AM Andrew Phillips &lt;<a href=3D"mai=
lto:[email protected]">[email protected]</a>&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr" class=3D"gmail_msg">&gt; See al=
so=C2=A0<a href=3D"https://issues.scala-lang.org/browse/SI-3664" rel=3D"nof=
ollow" class=3D"gmail_msg" target=3D"_blank">https://issues.scala-lang.org/=
browse/SI-3664</a>,=C2=A0<a href=3D"https://issues.scala-lang.org/browse/SI=
-5570" rel=3D"nofollow" class=3D"gmail_msg" target=3D"_blank">https://issue=
s.scala-lang.org/browse/SI-5570</a><div class=3D"gmail_msg"><br class=3D"gm=
ail_msg"></div></div><div dir=3D"ltr" class=3D"gmail_msg"><div class=3D"gma=
il_msg">Ah, thanks for the links, Adriaan! Going through the discussion thr=
eads, I&#39;m not quite clear how to summarize the &quot;something else&quo=
t; that you refer to ;-) There are a couple of comments that categorize thi=
s as spec omissions, and others that point to this being deliberately not i=
n the spec, and rather an &quot;implementation side-effect&quot; that one p=
resumably shouldn&#39;t rely on.</div><div class=3D"gmail_msg"><br class=3D=
"gmail_msg"></div><div class=3D"gmail_msg">Could you confirm if either of t=
hose two is the correct interpretation?</div><div class=3D"gmail_msg"><br c=
lass=3D"gmail_msg"></div><div class=3D"gmail_msg">Thanks!</div></div><div d=
ir=3D"ltr" class=3D"gmail_msg"><div class=3D"gmail_msg"><br class=3D"gmail_=
msg"></div><div class=3D"gmail_msg">ap</div></div>

<p class=3D"gmail_msg"></p>

-- <br class=3D"gmail_msg">
You received this message because you are subscribed to the Google Groups &=
quot;scala-language&quot; group.<br class=3D"gmail_msg">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" clas=
s=3D"gmail_msg" target=3D"_blank">[email protected]=
om</a>.<br class=3D"gmail_msg">
For more options, visit <a href=3D"https://groups.google.com/d/optout" clas=
s=3D"gmail_msg" target=3D"_blank">https://groups.google.com/d/optout</a>.<b=
r class=3D"gmail_msg">
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;scala-language&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">scal=
[email protected]</a>.<br />
For more options, visit <a href=3D"https://groups.google.com/d/optout">http=
s://groups.google.com/d/optout</a>.<br />

--001a11484f5647c1e305442d9d33--