Set up build.sbt with the following:
//TODO add cats
scalaVersion := "2.12.4"
libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.2.18"
libraryDependencies += "org.scalaz" %% "scalaz-concurrent" % "7.2.23"
libraryDependencies += "org.tpolecat" %% "doobie-core" % "0.5.3"
libraryDependencies += "org.scalaj" %% "scalaj-http" % "2.4.0"
initialCommands += "import scalaz._, Scalaz._"
I could probably use a similar technique on other types
val some = Some(1)
val list = List(2,3,4)
for {
s <- some
x <- list //expected option
} yield {...}
for {
s <- some.toSeq
x <- list
} yield {...} //works!
excludeFilter in unmanagedSources := "PsilosporeTest.scala"
I do this when I want to write short scripts but want all my imports available
set scalacOptions in <projectname> -= "-Ywarn-unused:imports"
I disable this when I'm actively developing while but reenable right before I commit
CMD + Shift + A Probably the most useful command. I don't have to bother with memorizing commands. I can search refactor, rename, do this do that blah blah
Cursor on first argument + Search Command + Use named arguments for current and subsequent arguments Not a big fan of long list of arguments.
case class Cat(name: String, age: Long, owner: Person)
Cat("tabby", 6, Person("Syed"))
//This will change to
Cat(
name = "tabby",
age = 6,
owner = Person("Syed")
)
## Others
### Scalafmt
Default setting looks like butt. Don't use it.