sbt run
- Run the http service on localhost:8989.sbt ~re-start
- Run the http service as above, but whenever the code changes, recompile and relaunch the service.
<project specific env setup>
Once the environment is configured, run
sbt test:compile
- Compile the tests without running themsbt test
- Run the tests oncesbt ~test
- As above, but rerun the tests whenever the code changessbt ~test-quick
- As above, but only run the tests affected by recompilation or tests which failed.
- Scalaz - An extended standard library for common FP patterns and types.
- http4s - http library (client and server)
- doobie - database library
- argonaut - json library
- ScalaTest - For testing
ConnectionIO[A]
- A description of a query or set of queries that when run will return values of some typeA
Task[A]
- A description of a computation or async operation that when run will return values of typeA
|@|
- aka "tie fighter operator" - You can think of(a |@| b) { f }
as "with all of these together, do f"
Example:
/** Repeats a string n times, for example `repeat("a", 2) == "aa"` */
def repeat(s: String, n: Int) = {
var result = ""
for (_ <- 0 until n) { result += s }
result
}
val hihihi = (Some("hi") |@| Some(3)) { case (s, n) => repeat(s, n) }
val hihihi_ = (Some("hi") |@| Some(3)) { repeat }
val nothing = (Some("hi") |@| None) { repeat }
nothing == None