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

<:< and <%<

1 reply
Kent Tong
Joined: 2010-01-27,
User offline. Last seen 2 days 3 hours ago.

Hi,

In the scala.Predef package there are two classes <:< and <%< and both
seem to denote a unary function covariant on the input and
contravariant on the output. But what's the difference between them?

Thanks!

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: <:< and <%<
<%< will resolve to ANY suitable implicit conversion available in scope<:< will only resolve to a function representing a "conversion" from some instance to the specified superclass

On 22 April 2011 15:35, Kent Tong <kent@cpttm.org.mo> wrote:
Hi,

In the scala.Predef package there are two classes <:< and <%< and both
seem to denote a unary function covariant on the input and
contravariant on the output. But what's the difference between them?

Thanks!



--
Kevin Wright

gtalk / msn : kev.lee.wright@gmail.comkev.lee.wright@gmail.commail: kevin.wright@scalatechnology.com
vibe / skype: kev.lee.wrightquora: http://www.quora.com/Kevin-Wright
twitter: @thecoda

"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra

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