Roman Janusz | 14 Apr 23:46 2015
Picon

Compiler plugin for warning suppression

Hello,

Recently, inspired by the Towards a Safer Scala talk from this year's ScalaDays, I wanted to try out the set of scalac options recommended by the speaker:

scalacOptions ++= Seq(
 
"-Xlint",
 
"-Xdeprecation",  
 
"-Xfatal-warnings"
)

Unfortunately, almost immediately I ran into a show-stopper: Scala has no warning suppression similar to Java's <at> SuppressWarnings. I googled around and unpleasantly found out that requests for this feature have been rejected. See for example SI-1781.

But I realized that writing a compiler plugin which could fill that gap would not be that hard.

So here it is: silencer

It would be nice to have some feedback from you, Scala users, to see if there is any interest in maintaining such plugin. The current proof-of-concept implementation is really simple and small, but uses internal scalac API, so I guess there's no guarantee that it won't break with some new Scala version. That is also why I think some community support would help a lot.

Cheers,
Roman

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
adam kozuch | 7 Apr 20:27 2015
Picon

Reviewing GSOC 2015 propositions

Hi,
I would like to ask about process of reviewing GSOC 2015 propositions. I didn't receive any feedback about my proposition. Is that mean that I probably will not be accepted or process of reviewing is ongoing?
 Thank you for answers,
Adam Kożuch

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
S Elini | 6 Apr 09:36 2015
Picon

Learning Scala

Hi everyone,

What is the best and quickest way to learn and master Scala for someone with little or no programming experience?
Is it possible to do it in less than 3 months time?

I have found Coursera's " Functional Programming Principles in Scala" a very good course but it seems that it is aimed for people with programming background and can be intimidating for people with no programming experience.

Thank you

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Brian McDevitt | 2 Apr 16:02 2015
Picon

Static code analysis tools/best practices

Is there a security-focused static code analysis tool for scala/play web applications similar to HP Fortify?  Or is the a best practice around this topic?


--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Algo- I | 31 Mar 08:48 2015
Picon

For all algorithm enthusiasts

We are building community for algorithm lovers,users and learners.
Please fill the form in the link below and help the community grow
Please share it as much as possible

http://goo.gl/forms/CsfA9BxWa8

fb page: https://www.facebook.com/algorithm.i

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Simon Schäfer | 25 Mar 20:26 2015
Picon

object.getClass is still an error in annotation

scala> object O
defined object O

scala> classOf[O.type]
<console>:9: error: class type required but O.type found
              classOf[O.type]
                       ^

It is broken. Therefore

scala> :paste
// Entering paste mode (ctrl-D to finish)

<at> pickling.directSubclasses(Array(classOf[O1.type]))
sealed abstract class C(val a: Int)
object O1 extends C(1)

// Exiting paste mode, now interpreting.

<console>:7: error: class type required but O1.type found
       <at> pickling.directSubclasses(Array(classOf[O1.type]))
                                                  ^

is also broken. There is another thing broken:

scala> :paste
// Entering paste mode (ctrl-D to finish)

<at> pickling.directSubclasses(Array(O1T))
sealed abstract class C(val a: Int)
object O1 extends C(1)
final val O1T = O1.getClass

// Exiting paste mode, now interpreting.

<console>:7: error: annotation argument needs to be a constant; found: this.O1T
       <at> pickling.directSubclasses(Array(O1T))
                                        ^

One workaround is:

scala> :paste
// Entering paste mode (ctrl-D to finish)

<at> pickling.directSubclasses(Array(classOf[O1]))
sealed abstract class C(val a: Int)
case class O1() extends C(1)

// Exiting paste mode, now interpreting.

defined class C
defined class O1

Not that awesome. Does anyone know another workaround? I don't even ask if anyone has the time to fix these - I don't know - 10 year old bugs (one ticket is https://issues.scala-lang.org/browse/SI-2453).

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

adam kozuch | 22 Mar 11:39 2015
Picon

Continue working on MongoDB dirver for Slick GSOC 2015

Hello,
My name is Adam Kożuch and I am master degree student of IT in University of Gdansk(Poland). I prepared sketch of proposition  for GSOC 2015 and I would like to get some feedback. This is not a final version but still I would like to know what do you think about it. Even if you are not interested in slick it would be grate if you could give me some general advice and point out some mistakes. (proposition in attachment) 
Thank you very much for help,
Adam

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Attachment (proposition.pdf): application/pdf, 71 KiB
Simon Adameit | 19 Mar 18:15 2015
Picon

Unexpected productIterator order

Hello,

we noticed some strange behaviour of productIterator in Scala 2.11.5:

case class Data(a: String, b: String, `a-some`: String)
val m = Data("1", "2", "3")
assert(m.productIterator.mkString(", ") == "1, 2, 3")

Result: "1, [3, 2]" did not equal "1, [2, 3]"

"a-some" can be any mangled symbol with an "a" prefix.

Is the order of productIterator on case classes guaranteed to be in parameter order? If so, this seems to be a bug. Can anyone reproduce it?

Regards,
Simon Adameit

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Milap Bhojak | 19 Mar 17:44 2015
Picon

GSOC - Implement other backends for Scaladoc

Hey Christopher,

Milap here from India. I'm pursuing my engineering in last year. I'm into open source since 2 years. I've been a contributor to VideoLAN, OpenStack Foundation and contributing as a managing member of Python Software Foundation. 

I've decided to spend my summer as a participant of Google Summer of code 2015. I've explored various projects from various organizations at the end I've found Implement other backends for Scaladoc project from Scala team. 

I've worked with Sphinx - Python documentation generator. So I'm familiar with plain PDF, single page HTML, multi page HTML things. I would really like to work on this project.

My skills: Python, Django, Scala, Java, angularJS, MongoDB, REST APIs, Google App engine.

Else I can adopt/Learn new things quickly. :) 

Please give me right arrows for this project so I can make it happen.

Thanks. 

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Muhammad Mohsin Khan Niazi | 17 Mar 09:14 2015
Picon

Improving IDE support for scala GSOC 2105

Hi everyone,

I am thinking to improve IDE support for Scala by pointing out improvements (inside code editor) that can help in writing better code. The main idea is inspired by what Resharper does for C# or IntelliJ/Netbeans does for Java 8. Take a simple example where anonymous method can be replaced by lambda expression Idea IDE will point out that this method can written in more concise way.

Similarly resharper points out many instances where single line LINQ can replace many lines of traditional code.

(image source: www.jetbrains.com)

Similarly for Scala we can replace a pattern matching solution: (Example from http://reactive.xploregroup.be/blog/9/Scala-tips:-Improving-the-imperfect-part-1)

val result: Option[String] = person.contactDetails match { case Some(details) => details.address match { case Some(address) => address.street match { case Some(street) => Some(street.capitalize) case _ => None } case _ => None } case _ => None }

with the flat map solution to get more concise code:

val result = person.contactDetails.flatMap { details => details.address.flatMap { address => address.street.map { street => street.capitalize } } }


But this is just the start we can have a look at other IDEs and think of our own ideas to
improve the IDE support for Scala including bug fixes. So what do you guys think of this idea?
Is it suitable for GSOC?

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Chayat | 15 Mar 23:01 2015
Picon

scalac does not infer super types when implicit for super type exists.

Hi all,

I'm reposting this after posting on scala-internals where it did not get much traction.

It seems that currently when inferring a type T which requires some implicit evidence R[T], 
scalac will start by inferring the most specific T possible, and upon failing to find evidence for that type
it will give up, even if evidence is present for a super type. 

Here's an example from SO (tinyurl.com/hmap-so-question):  


trait R[T] case class A(i: Int) object A { implicit object RA extends R[A] } class B(i: Int) extends A(i) def foo[T](x : T)(implicit ev: R[T]) = 0 println(foo(new B(1))) // infers T as B and fails to find implicit R[B] println(foo(new B(1) : A)) // Works, but undesirable


Another Example  (using spire):


import spire.algebra.AdditiveSemigroup
import spire.implicits._
 
sealed abstract class A(val j: Int)
 
object A {
 
implicit val ev: AdditiveSemigroup[A] = new AdditiveSemigroup[A] {
override def plus(x: A, y: A): A = (x, y) match {
case (B(l), B(r)) => B(l + r)
case _ => C(x.j + y.j)
}
}
 
}
 
case class B(i: Int) extends A(i)
 
case class C(i: Int) extends A(i)
 
B(1) + B(2) // Does not work because no evidence of AdditiveSemigroup[B]
 
(B(1) : A) + (B(2) : A) // Works - each B is also an A



IMO, this seriously undermines usage of subtyping to encode co-products, which is very idiomatic in scala.

I would like to propose the following change to type inference/implicit resolution: 
When trying to infer a type T which appears in some implicit parameter, the compiler should successivelt try inferring supertypes of the type it starts from only failing if it reaches Any without finding suitable implicits.

In my opinion, this should not violate any type system rules, given that all type rules must still be satisfied. I could always add type annotations which make things work - so there is no correctness problem here.  

I understand that this is not a formal enough definition, but my goal here is to start a discussion of this issue.

WDYT?

--
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 scala-language+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gmane