Asking once more: What's the status of deprecating view bounds?
ThanksHeikoOn Sep 6, 2012, at 10:26 AM, Heiko Seeberger <heiko.s...@gmail.com> wrote:Hi,Some time ago there has been a discussion whether to deprecate view bounds in 2.10.What's the status? Will that happen?ThanksHeiko
--
Heiko Seeberger
Twitter: @hseebergerBlog: heikoseeberger.nameCompany: Typesafe - The software stack for applications that scale
Author of "Durchstarten mit Scala, a tutorial-style Scala book"
On Wed, Sep 12, 2012 at 7:57 AM, Heiko Seeberger <heiko.s...@gmail.com> wrote:Asking once more: What's the status of deprecating view bounds?I'd be in favor. What do others think? - Martin
Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn
On Wed, Sep 12, 2012 at 7:57 AM, Heiko Seeberger <heiko.s...@gmail.com> wrote:
Asking once more: What's the status of deprecating view bounds?I'd be in favor. What do others think? - Martin
def foo[T <% Ordered[T]](x: T, y: T) = x < y
To get rid of the view bound, define a type alias
type OrderedView[T] = T => Ordered[T]
and rewrite foo to:
def foo[T: OrderedView](x: T, y: T) = x < y
"""On Wed, Sep 12, 2012 at 9:02 AM, Rex Kerr <ich...@gmail.com> wrote:
> On Wed, Sep 12, 2012 at 2:40 AM, martin odersky <martin....@epfl.ch>
> wrote:
> If the deprecation message could state how to change to a context bound,If the view bound is on a top level class, one would have to create a
> sure.
>
> Your example from before can probably be used almost verbatim:
>
> """
> A method with a view bound:
>
> def foo[T <% Ordered[T]](x: T, y: T) = x < y
>
> To get rid of the view bound, define a type alias
>
> type OrderedView[T] = T => Ordered[T]
>
> and rewrite foo to:
>
> def foo[T: OrderedView](x: T, y: T) = x < y
>
> """
package object to house the type def. I can imagine this being a bit
confusing, as many people haven't created package objects before.
Furthermore, they would introduce the type into namespace of the
package, which probably isn't desirable.
On Wed, Sep 12, 2012 at 7:57 AM, Heiko Seeberger <heiko.s...@gmail.com> wrote:
Asking once more: What's the status of deprecating view bounds?I'd be in favor. What do others think? - Martin
ThanksHeikoOn Sep 6, 2012, at 10:26 AM, Heiko Seeberger <heiko.s...@gmail.com> wrote:Hi,Some time ago there has been a discussion whether to deprecate view bounds in 2.10.What's the status? Will that happen?ThanksHeiko
--
Heiko Seeberger
Twitter: @hseebergerBlog: heikoseeberger.nameCompany: Typesafe - The software stack for applications that scale
Author of "Durchstarten mit Scala, a tutorial-style Scala book"--
Martin Odersky
Prof., EPFL and Chairman, Typesafe
PSED, 1015 Lausanne, Switzerland
Tel. EPFL: +41 21 693 6863
Tel. Typesafe: +41 21 691 4967
At this point, I'm terrified of adding anything to the compiler that isn't work/fixing already slated.
That said, I'd be for deprecation if we had a patch with significant test coverage!
If I've got the de-sugaring right, and every program expressed using T <% U can be re-written to a program that behaves the same way using an implicit T => U parameter, then I'd say deprecate <% and get the compiler to spit out the replacement equivalent implicit in the error message.
Roland Kuhn
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn
def f[K, V, T](map: T, k: K)(implicit ev: T => Map[K, V]): VThat does not look too bad? (or am I missing something?)
Any opinions/ideas/proposals/ideas on how to move this forward?
Maybe it makes sense to invite the wider ecosystem to comment on this issue?
Not sure if that makes sense or whether it we should take the usual approach of deprecating it, and then just wait and see how many people complain?)
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Yep! Direct syntactic support for type functions would be nice. Unfortunately, _'s semantic overloading budget was spent several times over (for full support for type functions, you'll also need to spend more syntax: one token for the type-level arrow, and figure out how to compactly specify kinds for the arguments)
Has a decision been made regarding when support for view bounds might be removed?
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Interesting. So "view bounds v2" may cause view bounds to be un-deprecated in 2.12. Any idea when there might be more clarity on this?
Interesting. So "view bounds v2" may cause view bounds to be un-deprecated in 2.12. Any idea when there might be more clarity on this?