Using Scalaz7 with Play - scala

I am having a little trouble in using Scalaz7 together with Play. Right now I am using the standard Play distribution with Scala 2.9.1 and scalaz-core 7.0-SNAPSHOT. This lives in the repository http://repo.typesafe.com/typesafe/repo/ which does not seem to be official. I am not sure about this, but there are already http://repo.typesafe.com/typesafe/snaphots/ and http://repo.typesafe.com/typesafe/releases/ and I do not know whether repo is officially endorsed and mantained. It is up now, but a few days ago it seemed to have vanished.
On the snapshots repository I see scalaz-core 7.0-M3, but only for Scala 2.9.2. I am not even sure which one between 7.0-SNAPSHOT and 7.0-M3 is the most updated version of scalaz, although most blog posts and docs I find seem to refer to version 7.0-M3.
So, given that I am developing a Play application which makes use of Scalaz, and it seems too much trouble to go back to scalaz 6 now that I have taken some time to learn scalaz 7,
what is the right way to use Scalaz 7 inside play? Should I go for the unofficial repo, as I am doing right now, or upgrade the project to Scala 2.9.2? Is Play! already supporting 2.9.2? If not, how should I upgrade?

Because play2 is using scala 2.9.1, by default sbt tries to get 2.9.1 scalaz library jars. However because scalaz7 has only been released for 2.9.2 you need to do the following to force it to download the 2.9.2 version. Scala 2.9.1 and 2.9.2 are compatible enough for this to work.
"org.scalaz" % "scalaz-core_2.9.2" % "7.0.0-M4"

Related

SASS support for Play Framework with Scala 2.13

We are currently trying to update our Play project to Scala 2.13. For SASS support we included sbt-sassify according to the documentation.
During the upgrade progress we noticed that sbt-sassify is only available for Scala 2.12. The Play docs do not suggest any alternative.
I just posted an issue at the plugins github page asking if support for 2.13 will come but as the last changes to the project are over a year old I have doubts there will be a timely reaction.
Has anyone else have this problem? Any ideas for replacements? Similar plugins like sbt-sass or play-sass seem to be rather dead and have no current artifacts in jcenter or similar repos.
Don't worry about that. SBT 1.x plugins are only available for Scala 2.12 in general.

Why does IDEA mark certain parts of Play code red?

I'm pretty new to the Play framework. I've been trying to configure it so I can use it with IntelliJ Ultimate.
I use following:
IntelliJ Ultimate 14.03
Scala plugin for IntelliJ 1.2.1
Play Framework 2.3.7 (the one that works online 1,2MB)
Scala 2.11
JDK 1.7
Windows 7
My problem is all about the fact that i can't make the errors disappear. Below is a simple example. When I create something more complicated (mapping etc.) I get entire blocks of red (also it does not suggest any code for the more complicated code).
What I've tried to fix it:
- deleting .idea folder and generating it again
- cleaning sbt
- generating a Play app from inside activator and also from IntelliJ
- re-installing IntelliJ
This is how I create the app from inside IntelliJ
I'm new both to Scala and Play, but I've done some research and I didn't end up with working solution. The same project works on Eclipse, but I would like to stick with IntelliJ.
The Scala plugin 1.2.1 is fairly outdated (given the development stage/pace of the Scala support in IntelliJ IDEA).
As of today, Jan, 29th, you should really be using the latest version of the Scala plugin 1.3.

possibility of scala-virtualized in Eclipse with Scala >=2.11

I followed this guide: http://lamplmscore.epfl.ch/mediawiki/index.php/Eclipse_IDE_with_Scala-virtualized
in order to use the virtualized (-Yvirtualize ) plugin inside the eclipse compiler. This works for a nightly build of Scala 2.10 which is old and lacks features like implicit classes. Does anyone know of a way to work with newer versions of Scala with the virtualize plugin AND eclipse?
Sorry to be bringing bad news:
The Eclipse IDE for Scala-virtualized has not been updated in the last 2 years, so it's not expected to be usable (Source: I maintained the EclipseIDE for scala-virtualized) -- I updated the wiki.
Regarding 2.11, please see Alexey's comment (and answer) below.
Scala-virtualized has been updated to 2.11.2 now. You can definitely use it in IDEA, at least (just make sure the Scala-virtualized scala-{library,reflect,compiler}.jar are above the non-virtualized versions in Dependencies tab under Project Settings -> Modules). I don't know if you can use it in Eclipse, but it might be possible using Scala installations support (see under BYOS (Bring Your Own Scala)).

In Eclipse, can I choose the version of Scala for my project?

Currently I'm using Scala IDE, and the version of Scala it's using for my project is 2.9.2. Preferably I'd like to choose 2.8.1, and am not sure how to select a version of the Scala Library.
Is there any way to change the version?
Thanks!
http://scala-ide.org/docs/user/gettingstarted.html
"The list of URLs of the different update sites are available in the download area. The release ones are in the current section. Scala IDE is linked to specific version of Scala, so you have to decide which one you are going to use:
release-29 provides support for projects using Scala 2.9.x (2.9.0-1 or 2.9.1). This is the current version of Scala. Pick this one if you are unsure.
release-28 provides support for projects using Scala 2.8.x (2.8.1 or 2.8.2)."
So you have to install release-28 Scala IDE to compile your Scala project with version 2.8.1 .
The release site can be found here:
http://scala-ide.org/download/current.html

What are main changes from scala 2.8.1 to scala 2.9.1?

I am working on project implemented in scala 2.8.1, want to migrate to scala 2.9.1 and use akka-actors libraries instead of standard, but didn't find good summary of main changes, here what I found:
Changes between Scala 2.8 and Scala 2.9
Changes in Version 2.9.0 (12-May-2011)
What are main changes from scala 2.8.1 to scala 2.9.1?
Changes that need big effort for migration.
UPDATE 1: Thanks, #VonC - Note: keep in mind some of those changes are backported in the upcoming 2.8.2: The Scala 2.8.2 distribution
UPDATE 2: Found Strange behavior of Set4 in scala 2.9.1 console
Parallel Collections I think is the biggest change, but in practical matters of migration, you don't have to worry too much about it. You might notice some libraries have dropped off. For example configgy is now deprecated, so check your underlying libs.
(Predef.)error is now deprecated, and there's new sys.error, so if you use a bunch of those, you'd see annoying warnings.
One major change that is not listed in the links, is around the time 2.9.0 came out the company Typesafe was formed. A part of the promise was their commitment to better binary compatibility going forward. For example, 2.9.1 is fully binary compatible with 2.9.0.1, and 2.8.2 is supposed to be compatible with 2.8.1 when it comes out.