This page is no longer maintained — Please continue to the home page at www.scala-lang.org

How to make this Scala implicit conversion work?

3 replies
Yang Zhang
Joined: 2010-02-09,
User offline. Last seen 42 years 45 weeks ago.

Posted this to SO a short while ago - anyone gurus here have an
answer? Thanks in advance.

http://stackoverflow.com/questions/8440122/how-to-make-this-scala-implic...

Peter 2
Joined: 2011-02-16,
User offline. Last seen 42 years 45 weeks ago.
Re: How to make this Scala implicit conversion work?

Hi Yang,

what about

implicit def x2node2helper[A](x: XRelation[A]) = new Helper(x)

Peter
See also: Graph for Scala

Yang Zhang
Joined: 2010-02-09,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: How to make this Scala implicit conversion work?

On Fri, Dec 9, 2011 at 1:28 AM, Sonnenschein wrote:
> Hi Yang,
>
> what about
>
> implicit def x2node2helper[A](x: XRelation[A]) = new Helper(x)
>
> Peter
> See also: Graph for Scala

I had a note near the bottom of my question explaining why this simple
solution isn't the one I'm seeking: it's to avoid having a
combinatorial explosion of implicit conversions to be defined.

Peter 2
Joined: 2011-02-16,
User offline. Last seen 42 years 45 weeks ago.
Re: How to make this Scala implicit conversion work?

> combinatorial explosion of implicit conversions to be defined.

For more clarity, could you please show what you are not getting
implicitly work?

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland