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

martin odersky <[email protected]> Wed, 21 Dec 2016 18:34:47 +0100
Newsgroups gmane.comp.lang.scala
Message-ID <CAENVNkaaEkbupKJpOUREzmABK6i+wAqXzX8ZvegYHNw_SRzz9Q@mail.gmail.com>
--001a11413460e9746505442e92f1
Content-Type: text/plain; charset=UTF-8

On Wed, Dec 21, 2016 at 5:26 PM, Adriaan Moors <[email protected]>
wrote:

> 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.
>
> Yes, that would be nice indeed!

 - Martin


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



-- 

Martin Odersky
EPFL and Lightbend

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

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

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Dec 21, 2016 at 5:26 PM, Adriaan Moors <span dir=3D"ltr">&lt;<a=
 href=3D"mailto:[email protected]" target=3D"_blank">adriaan@lightbend.=
com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
">I was making a <a href=3D"http://something-else.urbanup.com/2029280" targ=
et=3D"_blank">silly joke</a>=C2=A0;-) You give me three options and I can p=
ick 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 =
historic artifact or implementation detail/quirk (it&#39;s tricky to add pa=
rents to existing companion objects).=C2=A0</div><div><br></div><div>I agre=
e it&#39;s surprising that some but not all companions inherit FunctionN (t=
hough user-defined companions are treated differently in other ways too). T=
he original intent was to remove this surprise by not adding synthetic pare=
nts to any companion. We currently don&#39;t have plans to change this thou=
gh. Ultimately, it would be great to see a shapeless-light SIP that allows =
generically traversing structures of case classes.</div><div><br></div></di=
v></blockquote><div>Yes, that would be nice indeed!=C2=A0</div><div><br></d=
iv><div>=C2=A0- Martin</div><div>=C2=A0</div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div dir=3D"ltr"><div></div><div>cheers</div><span class=3D"HOEnZb"><font =
color=3D"#888888"><div>adriaan</div></font></span></div><div class=3D"HOEnZ=
b"><div class=3D"h5"><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"mailto:sharedocs1@=
gmail.com" target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><=
blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px=
 #ccc solid;padding-left:1ex"><div dir=3D"ltr" class=3D"m_57776479911721067=
4gmail_msg">&gt; See also=C2=A0<a href=3D"https://issues.scala-lang.org/bro=
wse/SI-3664" rel=3D"nofollow" class=3D"m_577764799117210674gmail_msg" targe=
t=3D"_blank">https://issues.scala-<wbr>lang.org/browse/SI-3664</a>,=C2=A0<a=
 href=3D"https://issues.scala-lang.org/browse/SI-5570" rel=3D"nofollow" cla=
ss=3D"m_577764799117210674gmail_msg" target=3D"_blank">https<wbr>://issues.=
scala-lang.org/<wbr>browse/SI-5570</a><div class=3D"m_577764799117210674gma=
il_msg"><br class=3D"m_577764799117210674gmail_msg"></div></div><div dir=3D=
"ltr" class=3D"m_577764799117210674gmail_msg"><div class=3D"m_5777647991172=
10674gmail_msg">Ah, thanks for the links, Adriaan! Going through the discus=
sion threads, I&#39;m not quite clear how to summarize the &quot;something =
else&quot; that you refer to ;-) There are a couple of comments that catego=
rize this as spec omissions, and others that point to this being deliberate=
ly not in the spec, and rather an &quot;implementation side-effect&quot; th=
at one presumably shouldn&#39;t rely on.</div><div class=3D"m_5777647991172=
10674gmail_msg"><br class=3D"m_577764799117210674gmail_msg"></div><div clas=
s=3D"m_577764799117210674gmail_msg">Could you confirm if either of those tw=
o is the correct interpretation?</div><div class=3D"m_577764799117210674gma=
il_msg"><br class=3D"m_577764799117210674gmail_msg"></div><div class=3D"m_5=
77764799117210674gmail_msg">Thanks!</div></div><div dir=3D"ltr" class=3D"m_=
577764799117210674gmail_msg"><div class=3D"m_577764799117210674gmail_msg"><=
br class=3D"m_577764799117210674gmail_msg"></div><div class=3D"m_5777647991=
17210674gmail_msg">ap</div></div>

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

-- <br class=3D"m_577764799117210674gmail_msg">
You received this message because you are subscribed to the Google Groups &=
quot;scala-language&quot; group.<br class=3D"m_577764799117210674gmail_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"m_577764799117210674gmail_msg" target=3D"_blank">scala-language+unsubs=
cribe@<wbr>googlegroups.com</a>.<br class=3D"m_577764799117210674gmail_msg"=
>
For more options, visit <a href=3D"https://groups.google.com/d/optout" clas=
s=3D"m_577764799117210674gmail_msg" target=3D"_blank">https://groups.google=
.com/d/<wbr>optout</a>.<br class=3D"m_577764799117210674gmail_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]" targ=
et=3D"_blank">scala-language+unsubscribe@<wbr>googlegroups.com</a>.<br>
For more options, visit <a href=3D"https://groups.google.com/d/optout" targ=
et=3D"_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
</div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=
<div class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><br>Marti=
n Odersky<br>EPFL and Lightbend</div>
</div></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 />

--001a11413460e9746505442e92f1--