These are chat archives for typelevel/scala

21st
Sep 2016
Miles Sabin
@milessabin
Sep 21 2016 09:33
@paulp @soronpo I've been a bit bogged down with fallout from 2.12.0-RC1. I should be able to get a 2.11.8 update out by the end of the week.
@soronpo that looks pretty awesome :-)
I'm doing a talk on TLS at Lambda World at the end of next week. I'd love to include a few examples like this :-)
Oron Port
@soronpo
Sep 21 2016 10:32
@milessabin You're welcome to use it.
You have at least one happy user :smile: I was looking forward to hear a SIP-23 discussion in the SIP meeting, but no luck. Only thanks to TLS I was able to use it so early.
Miles Sabin
@milessabin
Sep 21 2016 10:35
:+1:
Oron Port
@soronpo
Sep 21 2016 11:14
Of course I'm looking forward for having a 21.type + 21.type SIP, to allow any literal inducing expression to be directly placeable as a generic type. If the compiler can know it's (gonna be) a literal, then why not allow it.
Oron Port
@soronpo
Sep 21 2016 12:04
Is it possible to create an unroll macro to unroll a loop and make the following work?
  def demo[L <: XInt](implicit p : L*L + L) : p.Out {} = p.value
  @unroll for (i <- 1 to 5) {
    val b = demo[i]
  }
Miles Sabin
@milessabin
Sep 21 2016 12:06
I don't think so.
No, it isn't ... they have to be definition-level: http://docs.scala-lang.org/overviews/macros/annotations.html
Oron Port
@soronpo
Sep 21 2016 12:08
and if I create a definition For(range : Range, body : Unit) ?
Meaning, For is a macro that unrolls its body
Oron Port
@soronpo
Sep 21 2016 12:32
Maybe something along the lines of:
  def demo[L <: XInt](implicit p : L*L + L) : p.Out {} = p.value
  trait Rng[LBound <: XInt, UBound <: XInt] {
    type Iter <: XInt
  }
 @unroll def For[I <: Rng[_ <: XInt,_ <: XInt]](implicit i: I) = {
    demo[i.Iter]
  }
Miles Sabin
@milessabin
Sep 21 2016 12:38
Maybe ... give it a try :-)
You should probably ping @non about this sort of thing.
BennyHill
@BennyHill
Sep 21 2016 13:09
@milessabin Assuming it's actually technically possible, would having scoverage instrumentation for the tests be useful/worth the effort?
Or is there already a baked in soln that suffices, I can't quite work that out
Miles Sabin
@milessabin
Sep 21 2016 13:12
For TLS as a whole?
BennyHill
@BennyHill
Sep 21 2016 13:12
for the compiler build
and junit tests
Miles Sabin
@milessabin
Sep 21 2016 13:13
Interesting. TBH, I think you need to talk to the Lightbend team about this ... I think they might be interested.
BennyHill
@BennyHill
Sep 21 2016 13:13
Ok, np - just thought I would test the water here first ;)
Miles Sabin
@milessabin
Sep 21 2016 13:14
We're piggybacking on their CI at the moment, so it would be more useful to have support at their end.
Gotcha :-)
BennyHill
@BennyHill
Sep 21 2016 13:14
:+1: